Convert pixels to rem/em using any root font-size (default 16px) with a quick CSS scale reference table.
REM is relative to the root <html> font-size (16px by default in browsers). Formula: rem = px / rootFontSize. Using rem lets users scale browser font sizes accessibly.
| PX | REM | Tailwind Utility |
|---|---|---|
| 12px | 0.75rem | text-xs / p-3 |
| 14px | 0.875rem | text-sm / p-3.5 |
| 16px | 1rem | text-base / p-4 |
| 20px | 1.25rem | text-xl / p-5 |
| 24px | 1.5rem | text-2xl / p-6 |
| 32px | 2rem | text-3xl / p-8 |
16px in Chrome, Safari, Firefox, and Edge, so 1rem = 16px unless overridden on html.
Use rem for consistent typography and spacing across the page; use em when padding/margins should scale relative to the component's own font-size.
Yes, Tailwind uses 1 unit = 0.25rem = 4px (e.g., p-4 = 1rem = 16px).
Convert px, dp, and sp across mdpi, hdpi, xhdpi, xxhdpi, and xxxhdpi with smallest-width qualifiers.
Convert CSS HEX, RGB, HSL, and Android #AARRGGBB color codes and verify WCAG 2.1 AA/AAA text contrast ratios.
Estimate input/output tokens and compare API costs across GPT, Claude, Gemini, and DeepSeek.
Beautify, validate, sort keys, and minify JSON locally in your browser.