What is a px to rem converter?
Designs in Figma, Sketch or Adobe XD are measured in pixels, but modern CSS often uses rem units so text and spacing scale with the reader's font settings. A px to rem converter does the division for you, using your site's root font size.
Front-end developers use it to translate a design system's type scale and spacing tokens into CSS, Tailwind or design tokens. Paste a whole list of sizes, get a table of rem values with their percentage of the root, and convert the other way when you need to know how big a rem value renders.
How to use the px to rem Converter
1.Choose the direction
px to rem, or rem to px.
2.Paste your values
One or many, with or without the px or rem unit.
3.Check the root size
16px unless your site changes the html font size.
Example: a type scale at 16px
Seven sizes from a design file, with the default 16px root:
- 12px / 14px
- 0.75rem / 0.875rem
- 16px
- 1rem
- 18px / 24px
- 1.125rem / 1.5rem
- 32px / 48px
- 2rem / 3rem
rem = px ÷ root font size
The whole scale converts in one step, ready to paste into a stylesheet.
Why rem instead of px
A rem is relative to the root element's font size. When people raise the default text size in their browser for readability, rem-based sizes grow with it while fixed pixel sizes don't, so rem makes type, spacing and layouts more accessible.
Browsers default the root font size to 16px, so 1rem = 16px and 24px = 1.5rem. Some sites set html { font-size: 62.5% } so that 1rem = 10px; enter 10 as the root size to match. em units work the same way but relative to the parent element, which compounds when nested.
Frequently asked questions
How many px is 1rem?
16px by default, or whatever the html element's font size is set to.
How do I convert px to rem?
Divide by the root font size: 24 ÷ 16 = 1.5rem.
Should I use rem for everything?
rem suits font sizes and spacing; borders and hairlines often stay in px.
What's the difference between rem and em?
rem is relative to the root font size; em is relative to the current element's font size, so nested ems multiply.
Related tools
CSS clamp() Generator for Fluid Sizes
Fluid font sizes and spacing that scale between two viewport widths.
Aspect Ratio Calculator
Find an image or video's aspect ratio and resize it without distortion.
PPI Calculator (Pixel Density)
Pixel density of a screen from its resolution and diagonal size.
Type scale generator
Font sizes from a ratio, with fluid clamp() and CSS variables.
Font pairing
Preview heading and body font combinations from Google Fonts.
Font inspector
See a font file's names, licence, glyphs and language support.
More Developer tools
JSON & data
CSV tools
Network & system
Web & API
Git & releases
Encoding & security
- Base64 encode & decode
- URL encode & decode
- JWT decoder
- Hash generator
- HTML entity encoder
- Text to binary
- Morse code translator
- Caesar cipher & ROT13
- Random string generator
- Secret key generator
- 2FA code generator (TOTP)
- Encrypt & decrypt text
- Encrypt & decrypt files
- SSH key generator
- Base32 encoder and decoder
- Unicode escape converter
- Nano ID generator
- JWT generator
Text & code
- Regex tester
- Text diff checker
- Cron expression explainer
- Lorem ipsum generator
- Markdown previewer
- Slug generator
- Strip HTML tags
- Unicode character inspector
- URL parser
- Markdown TOC generator
- cURL converter
- Whitespace visualizer
- Markdown link extractor
- Regex escape
- Regex match extractor
- Split text by regex
- HTML, CSS and JS playground
- Mock data generator
- Keyboard event tester
- ASCII table