Developer Tools

Px to REM / EM Converter

Convert pixels to rem and em (and back). Custom base font-size, Tailwind reference table, batch input.

Quick conversion

px
16px
rem
1rem
em (assumes parent = base)
1em
point (pt)
12.00pt
cm (96 dpi)
0.423cm
Batch convert (one px value per line)
Tailwind size reference (default base 16px)
Tailwind classrempx (base 16)
text-xs / p-10.25rem4px
text-sm / p-20.5rem8px
p-30.75rem12px
text-base / p-41rem16px
text-lg / p-51.25rem20px
p-61.5rem24px
text-xl / p-71.75rem28px
text-2xl / p-82rem32px
text-3xl / p-102.5rem40px
text-4xl / p-123rem48px
text-5xl / p-143.5rem56px
text-6xl / p-164rem64px

Why use rem instead of px?

Accessibility.When users increase text size in browser settings, elements sized in rem scale proportionally — elements in px don't. Around 15% of users have non-default zoom or text-size settings. Using rem for typography and most layout respects those preferences.

Frequently Asked Questions

When should I use rem vs em vs px?
rem: most layout sizes (margins, padding, font-size of components). Predictable — always relative to the root html element. em: when you want a value relative to the parent's font-size (rare). px: 1px borders, very specific small sizes where rem rounding would be visible.
Why does the default base = 16px?
Browsers default the html element's font-size to 16px (this has been standard since HTML 4). 1rem = 16px. Some CSS reset patterns set html { font-size: 62.5% } so 1rem = 10px, making mental math easier (1.6rem = 16px). We support custom base font-size for that case.
What's the accessibility benefit of rem?
When users zoom text in their browser settings (~15% of users do this), elements sized in rem scale proportionally. Elements in px stay fixed and may overflow or look tiny. Use rem for typography and most layout to respect user preferences.
Do I need to convert when using Tailwind?
Tailwind's default size scale is already in rem (text-base = 1rem = 16px, p-4 = 1rem, etc.). You generally don't convert — just use the utility class. We show the Tailwind reference table below for quick lookup.
What about responsive scaling (vw, vh, %)?
rem is for static sizes (a button stays the same physical size). vw/vh scale with viewport (100vw = full screen width). Best practice: rem for typography and components, vw/vh for hero heights, % for fluid widths. Mix them — modern CSS welcomes it.

Related Calculators