Px to Rem Converter
Convert px and rem using your chosen base font size, with batch conversion and copyable CSS.
Default browser root font size is 16px.
em uses the parent for font-size; rem uses the root. Other em lengths use the element’s font size.
Conversion Direction
Single Conversion
Quick Reference Table
| px | rem | em | CSS | Copy |
|---|---|---|---|---|
| 8 | 0.5 | 0.5 | font-size: 0.5rem; /* 8px */ | |
| 12 | 0.75 | 0.75 | font-size: 0.75rem; /* 12px */ | |
| 14 | 0.875 | 0.875 | font-size: 0.875rem; /* 14px */ | |
| 16 | 1 | 1 | font-size: 1rem; /* 16px */ | |
| 18 | 1.125 | 1.125 | font-size: 1.125rem; /* 18px */ | |
| 20 | 1.25 | 1.25 | font-size: 1.25rem; /* 20px */ | |
| 24 | 1.5 | 1.5 | font-size: 1.5rem; /* 24px */ | |
| 32 | 2 | 2 | font-size: 2rem; /* 32px */ | |
| 48 | 3 | 3 | font-size: 3rem; /* 48px */ | |
| 64 | 4 | 4 | font-size: 4rem; /* 64px */ |
Batch Converter
Runs locally in your browser. Nothing is uploaded or sent to a server.
Enter a pixel value with a 16px base font size to get the rem equivalent: 16px = 1rem, 24px = 1.5rem, 32px = 2rem. Change the base font size to match your project's root font size (common values: 10px, 14px, 16px, 18px). Use the batch converter to paste a list of values and convert all at once. Choose 2, 3, or 4 decimal places for rem output. Set a separate parent font size for em, or use CSS PX to REM Converter for a complete stylesheet.
Updated
Related Tools
CSS PX to REM Converter
Convert CSS px values to rem or em. Filter properties, preserve media conditions and 1px borders, review changed declarations, and copy or download CSS.
developer-toolsJSON Formatter
Beautify or minify JSON, inspect its structure, and copy or download the result in your browser.
design-toolsCSS Loader Generator
Build CSS loaders with usage presets, unique class prefixes and reduced-motion fallbacks.
developer-toolsBase64 Encode / Decode
Convert text or files, repair Base64 padding, choose charsets, and process separate lines locally.
developer-toolsRegex Tester
Inspect JavaScript regex matches, preview replacements, and download repeatable test cases.
What Are 0.9rem, 1.4rem, and Other Rem Values in Pixels?
0.9rem is 14.4px at a 16px base. The formula is px = rem × root font size in pixels; reverse it with rem = px ÷ root font size. These examples use the converter's initial 16px base, so change that field if your page uses a different computed root size.
| Rem | Pixels at a 16px base |
|---|---|
| 0.25rem | 4px |
| 0.9rem | 14.4px |
| 1.125rem | 18px |
| 1.2rem | 19.2px |
| 1.4rem | 22.4px |
| 1.5rem | 24px |
Select rem → px / em and enter the rem value to reproduce a row. The displayed results round to at most four decimal places. The copyable CSS shows the converted value with the original value in a comment, making it easier to compare the output with your source stylesheet.
Why Convert Pixels to Rem in CSS?
A CSS pixel is a device-independent length unit. A rem is a multiple of the root element's computed font size. When that root size is 16px, 1rem equals 16px, 1.5rem equals 24px, and 2rem equals 32px. Converting a design measurement to rem expresses it relative to that root rather than keeping it as a fixed CSS pixel value.
This can help typography and spacing respond together when the root font size changes. For example, a 1.5rem heading becomes 30px when the root grows from 16px to 20px. A 24px heading keeps its CSS pixel size under that root change, although browser zoom can still enlarge it. Unit choice alone does not guarantee accessible text resizing: test the complete layout for clipping, overlapping controls, and lost content as text grows.
The converter performs arithmetic only. It does not read styles from your website, detect inherited font sizes, inspect media queries, or certify accessibility. Find the actual computed root font size in your browser's style inspector and enter it as the base. Using an assumed base that differs from your page can produce a mathematically correct conversion that is wrong for the layout you are editing.
How Does Rem Conversion Work Mathematically?
For pixels to rem, divide by the base: 24px ÷ 16px = 1.5rem. For rem to pixels, multiply by the base: 1.5 × 16px = 24px. The base field accepts a positive number. If it is empty, invalid, or nonpositive, the converter shows an error and suspends calculations. A decimal base is also usable when that matches the computed root font size.
The tool calculates rem from the root font size and em from the separate parent font size. In real CSS, em depends on its context. For an element's font-size, it refers to the parent font size; for many other lengths, it refers to the element's own font size. A child with font-size: 0.9em under a 20px parent computes to 18px, while 0.9rem at a 16px root is 14.4px. Enter the relevant context yourself when using the em output.
What Are Common Pixel-to-Rem Conversion Values?
The formula for this reference is rem = pixel value ÷ 16. The interactive quick reference uses your selected base instead, so its values update when that base changes. These examples can help compare spacing and font-size values without assuming a particular heading scale or visual design.
| Pixels | Rem at a 16px base |
|---|---|
| 8px | 0.5rem |
| 12px | 0.75rem |
| 14px | 0.875rem |
| 16px | 1rem |
| 18px | 1.125rem |
| 20px | 1.25rem |
| 24px | 1.5rem |
| 32px | 2rem |
| 48px | 3rem |
| 64px | 4rem |
How Do I Use Fluid Typography with Rem and clamp()?
CSS clamp() bounds a preferred value between a minimum and maximum. For example, font-size: clamp(1rem, 2.5vw, 1.5rem) has a 16px minimum and 24px maximum when the root is 16px. Its preferred value uses viewport width. The converter can calculate those rem boundaries, but it does not evaluate the viewport-dependent expression or generate a fluid type scale.
Relative boundaries do not by themselves guarantee accessible resizing. Check the page at enlarged text settings and different viewport widths. A heading can reach its maximum while the preferred viewport value still responds differently from user font preferences. Use the arithmetic here to understand individual values, then verify their behavior in the real stylesheet. The batch converter is useful for converting several fixed boundary values with the same root size.
What Is the 10px Rem Trick and Should I Use It?
Setting html { font-size: 62.5%; } makes the root 10px when the inherited browser default is 16px: 16 × 0.625 = 10. That percentage still responds to a changed default; with a 20px default, the root becomes 12.5px. It does not inherently disable user preferences. Enter the actual computed root size rather than assuming this declaration always means 10px.
At a 10px root, 14px converts to 1.4rem and 24px to 2.4rem. At a 16px root, those same pixel values convert to 0.875rem and 1.5rem. Choose the base that matches the stylesheet you maintain. The tool supports either convention and does not modify the root element or rewrite CSS files. Paste a list of numeric values into Batch Converter to obtain separate declarations you can review before copying.
How to Use Px to Rem Converter
-
Set your base font size
Enter your project's root font size in the Base Font Size field. The converter starts with a 16px base; use the actual computed root font size for your page. If html { font-size: 62.5%; } computes to 10px in your page, set the base to 10px. The quick reference table and all conversions update instantly when you change the base.
-
Choose conversion direction
Select px → rem/em to convert pixel values to relative units, or rem → px to reverse the direction. Use reverse conversion when you see a rem value in existing code and need to understand the pixel size it represents at your current base font size.
-
Convert a single value
Type a value in the Single Conversion field. The result shows the rem equivalent, the em equivalent, and the corresponding CSS property declaration ready to copy. For pixel input, the output is 'font-size: 1.5rem; /* 24px */' format - the comment preserves the original pixel intent.
-
Batch convert multiple values
Paste a list of px values into the Batch Converter textarea, separated by spaces, commas, or newlines. All values convert instantly. Copy the full CSS output block with one click to paste directly into your stylesheet.