Type a pixel value to get rem and em, or a rem value to get pixels. Change the root font size (16px in browsers by default) and the parent size for em, and copy the CSS value.
Browsers default to 16px.
rem
1.5rem
em (in this parent)
1.5em
Percent of root
150%
Common sizes at a 16px root
| Pixels | rem |
|---|---|
| 10px | 0.625rem |
| 12px | 0.75rem |
| 14px | 0.875rem |
| 16px | 1rem |
| 18px | 1.125rem |
| 20px | 1.25rem |
| 24px | 1.5rem |
| 28px | 1.75rem |
| 32px | 2rem |
| 40px | 2.5rem |
| 48px | 3rem |
px to rem, em and percent
rem and em back to px
Any root and parent font size
Table of common sizes from 10 to 48px
Copy the value for your CSS
Turn pixel sizes from a Figma or Adobe XD file into rem for accessible CSS.
Replace fixed px font sizes and spacing with rem so text grows with the user's browser setting.
Work out an em value when a component sits inside a parent with its own font size.
A design uses a 24px heading and 14px body text, and the site keeps the browser's 16px root.
More for developers: Viewport Unit Calculator, 8px Grid Calculator, Color Converter, CSS Minifier.
CSS Minifier
Minify CSS to reduce file size
Color Converter
Convert color formats
Unit Converter
Convert length, weight, temperature, area, volume, speed, data and time units
HTML Minifier
Remove comments and extra whitespace from HTML, keeping pre, script and style intact
CSS clamp() Generator
Fluid font sizes, padding and gaps between two screen widths
Spacing Scale Generator
Spacing tokens from a 4px or 8px unit as CSS variables, Tailwind or JSON
Type Scale Generator
Modular or fluid type scales as CSS variables or Tailwind
JSON Formatter
Format and validate JSON
JSON Sort Keys
Alphabetize JSON keys at every level
JSON Flatten
Nested JSON to dot-path keys
JSON Unflatten
Dot-path keys back to nested JSON
Built by Edesy
Edesy builds AI products for Indian businesses. Start self-serve, no demo call needed.
AI agents that answer and make phone calls 24/7. Handle appointments, inquiries and support in Indian and global languages.
₹50 free credit. No demo call needed.