All tools / 04 CSS and design
px to rem converter
rem is relative to the root font size, so layouts follow the user's browser settings. Set your root size (16 px is the browser default) and convert one value, a whole stylesheet, or look one up in the table.
Tailwind spacing: 6 (for example p-6)
Convert a stylesheet
Converted to rem
The converted CSS shows here, ready to copy. Paste your CSS on the left first.
Common sizes at 16 px
| px | rem | Tailwind spacing | Tailwind text |
|---|---|---|---|
| 1px | 0.0625rem | ||
| 2px | 0.125rem | ||
| 4px | 0.25rem | 1 | |
| 6px | 0.375rem | ||
| 8px | 0.5rem | 2 | |
| 10px | 0.625rem | ||
| 12px | 0.75rem | 3 | text-xs |
| 14px | 0.875rem | text-sm | |
| 16px | 1rem | 4 | text-base |
| 18px | 1.125rem | text-lg | |
| 20px | 1.25rem | 5 | text-xl |
| 24px | 1.5rem | 6 | text-2xl |
| 28px | 1.75rem | 7 | |
| 32px | 2rem | 8 | |
| 36px | 2.25rem | 9 | text-4xl |
| 40px | 2.5rem | 10 | |
| 44px | 2.75rem | 11 | |
| 48px | 3rem | 12 | text-5xl |
| 56px | 3.5rem | 14 | |
| 64px | 4rem | 16 | |
| 72px | 4.5rem | 18 | |
| 80px | 5rem | 20 | |
| 96px | 6rem | 24 | |
| 128px | 8rem | 32 |