Direct Answer
To convert pixels to rem, divide by the root font size (default 16px): rem = px ÷ 16. Common values: 12px = 0.75rem, 14px = 0.875rem, 16px = 1rem, 18px = 1.125rem, 24px = 1.5rem, 32px = 2rem. Rem units scale with user browser preferences, making them the accessibility-standard choice for typography and spacing in modern CSS.
Use the PX to REM Converter for any pixel value with a custom base font size.
Last verified on: June 22, 2026
Editorial note: This cheat sheet assumes a 16px root font size unless noted. Projects using 62.5% html font-size (10px base) require different mental math — use the converter with your actual base.
Research method: Conversions verified against W3C CSS Values and Units Module Level 3 and browser default style sheets, checked June 22, 2026.
The PX to REM Formula
rem = px / root font-size (px)
Default: rem = px / 16
Reverse: px = rem * 16
Example: 20px ÷ 16 = 1.25rem
Complete Cheat Sheet (16px Base)
Typography scale
| Pixels | REM | Common use |
|---|---|---|
| 10px | 0.625rem | Fine print, captions |
| 12px | 0.75rem | Small labels, footnotes |
| 14px | 0.875rem | Secondary body, form hints |
| 16px | 1rem | Body text default |
| 18px | 1.125rem | Large body, lead paragraphs |
| 20px | 1.25rem | H6, small headings |
| 24px | 1.5rem | H5, section titles |
| 32px | 2rem | H4, page titles |
| 48px | 3rem | H2, hero subheads |
| 64px | 4rem | H1, display headings |
Spacing scale (4px grid)
| Pixels | REM | Common use |
|---|---|---|
| 4px | 0.25rem | Tight padding, icon gaps |
| 8px | 0.5rem | Inline spacing, small gaps |
| 12px | 0.75rem | Component internal padding |
| 16px | 1rem | Standard padding unit |
| 24px | 1.5rem | Section padding |
| 32px | 2rem | Large section gaps |
| 48px | 3rem | Page section margins |
| 64px | 4rem | Hero vertical spacing |
Quick Reference: Popular Design Values
| Design spec | REM (16px base) | CSS snippet |
|---|---|---|
| 14px text | 0.875rem | font-size: 0.875rem; |
| 16px text | 1rem | font-size: 1rem; |
| 18px text | 1.125rem | font-size: 1.125rem; |
| 24px heading | 1.5rem | font-size: 1.5rem; |
| 8px gap | 0.5rem | gap: 0.5rem; |
| 16px padding | 1rem | padding: 1rem; |
| 32px margin | 2rem | margin-bottom: 2rem; |
When to Use REM vs EM vs PX
| Unit | Relative to | Best for |
|---|---|---|
| rem | Root (html) size | Typography, spacing, layout |
| em | Parent element | Component-scoped scaling |
| px | Fixed device pixel | Borders (1px), shadows, fine lines |
Use rem for anything that should respect user font-size preferences. Use px only where sub-pixel precision matters and accessibility scaling would break the design (hairline borders).
Custom Base Font Size
If your project sets html { font-size: 62.5%; } (10px base):
| Pixels | REM with 10px base |
|---|---|
| 16px | 1.6rem |
| 24px | 2.4rem |
| 32px | 3.2rem |
Always confirm your project’s root before converting from a design comp.
Worked Examples at Different Base Sizes
Design comps often arrive in px. Here is how common values convert at three common root settings:
| Pixels | 16px base (default) | 10px base (62.5%) | 20px base (user pref.) |
|---|---|---|---|
| 12px | 0.75rem | 1.2rem | 0.6rem |
| 16px | 1rem | 1.6rem | 0.8rem |
| 24px | 1.5rem | 2.4rem | 1.2rem |
| 32px | 2rem | 3.2rem | 1.6rem |
If your project uses html { font-size: 62.5%; }, divide px by 10 instead of 16. Always confirm in DevTools before shipping.
Tailwind CSS Quick Mapping
Tailwind’s default spacing scale uses rem under the hood. These are the most common class-to-pixel mappings at 16px root:
| Tailwind class | REM value | Pixels | Typical use |
|---|---|---|---|
text-xs | 0.75rem | 12px | Captions, fine print |
text-sm | 0.875rem | 14px | Secondary text, labels |
text-base | 1rem | 16px | Body copy |
text-lg | 1.125rem | 18px | Lead paragraphs |
text-xl | 1.25rem | 20px | Small headings |
text-2xl | 1.5rem | 24px | Section headings |
p-4 | 1rem | 16px | Card padding |
gap-6 | 1.5rem | 24px | Grid/flex gaps |
Project Setup Checklist
Before converting a design system from px to rem:
- Confirm root font size in
html { font-size }— default is 16px (100%) - Document the base in your design tokens or README
- Convert typography scale first (most accessibility impact)
- Convert spacing scale second (padding, margin, gap)
- Keep 1px borders and hairlines in px — they should not scale
- Test at 200% browser zoom to verify layout holds (WCAG 1.4.4)
- Use per-value pages like 16px to REM for quick lookups
Related Reading
- PX to REM Converter — instant conversion with custom base font size
- 16px to REM — common body-text conversion at default root
- 24px to REM — heading-size conversion at 16px base
Official and Supporting Sources
- W3C CSS Values and Units Module Level 3 — Relative Lengths (rem)
- MDN Web Docs: rem CSS unit
- WCAG 2.2 — Resize Text (Understanding 1.4.4)
- Daily Calcs PX to REM Converter
Next Step
Open the PX to REM Converter, enter any pixel value, set your base font size, and copy the rem result directly into your CSS.
Frequently Asked Questions
How do you convert pixels to rem?
Divide the pixel value by the root font size (browser default is 16px). Formula: rem = px / base font size. Example: 24px ÷ 16px = 1.5rem. If you change the root to 10px for easier mental math, 24px becomes 2.4rem. Always confirm which base your project uses — design systems often document this in their typography scale. The rem unit is relative to the html element's font-size, not the parent element.
What is 16px in rem?
At the default 16px root font size, 16px equals exactly 1rem. This is the browser default for most user agents and the reference point for most px-to-rem cheat sheets. Body text at 1rem respects user browser font-size preferences, which is why rem is preferred over px for accessible typography. If a user sets their browser default to 20px, 1rem renders as 20px on screen.
Why use rem instead of px for CSS?
Rem units scale with the user's root font-size preference, improving accessibility for visually impaired users who enlarge default text. They also simplify responsive design — changing html { font-size } cascades proportionally through all rem-based sizing. Px units are fixed and ignore user preferences unless you use relative units. Most modern design systems use rem for spacing and typography, reserving px for borders and shadows.
What is the most common px to rem conversion base?
16px is the universal default — set by all major browsers and used in the W3C reference pixel definition. Many teams temporarily set html { font-size: 62.5% } (making 1rem = 10px) for easier mental math, then use rem values like 1.6rem for 16px equivalent. Others keep 100% (16px) and memorize common conversions. Our cheat sheet uses 16px base unless noted.
How do I convert rem back to pixels?
Multiply rem by the root font size: px = rem * base. At 16px base, 1.5rem = 24px and 0.875rem = 14px. The PX to REM Converter on Daily Calcs supports bidirectional conversion — enter rem to get px or px to get rem with a custom base font size. This is useful when inspecting a design comp in px and writing CSS in rem.
px vs rem: Which should you use for CSS typography?
Use rem for font sizes, spacing, and layout rhythm so text scales with the user's root font-size preference — important for accessibility. Use px for hairline borders, shadows, and fixed bitmap dimensions where scaling would break the design. Most design systems set body text at 1rem (16px default) and headings at 1.5rem to 3rem. The cheat sheet below assumes 16px root unless noted.
What px values should I memorize for rem conversion?
At 16px base, memorize these: 12px = 0.75rem, 14px = 0.875rem, 16px = 1rem, 18px = 1.125rem, 20px = 1.25rem, 24px = 1.5rem, 32px = 2rem, 48px = 3rem, 64px = 4rem. These cover 90% of typography and spacing decisions in web UI. For spacing scales (4px, 8px, 16px, 24px, 32px), divide by 16: 8px = 0.5rem, 4px = 0.25rem.
Related guides
- Cost of Living Comparison by City - Salary Guide (2026) Compare cost of living by city with equivalent salary math. See how $85k in Austin compares to San Francisco, NYC, and Houston. Free COL calculator.
- Hourly Rate Calculator - What Is Your Time Worth? (2026) Convert salary to hourly rate instantly. See what $60k, $75k, or $100k really pays per hour after your work schedule. Free salary-to-hourly calculator.