PX to REM Converter
Convert between pixels and rem/em units online for responsive CSS. Free PX to REM converter with custom base font size support.
Default browser font size is 16px. Adjust if your project uses a different base.
| Pixels | REM | |
|---|---|---|
| 8px | 0.5rem | |
| 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 | |
| 36px | 2.25rem | |
| 40px | 2.5rem | |
| 48px | 3rem | |
| 56px | 3.5rem | |
| 64px | 4rem | |
| 72px | 4.5rem | |
| 80px | 5rem | |
| 96px | 6rem |
About PX to REM Converter
Convert between pixels and rem units for CSS. REM units are relative to the root font size, making them useful for responsive design. The default browser font size is 16px.
How to Use PX to REM Converter
Enter a pixel value
Type the number you want to convert, like 24. The conversion appears immediately as you type.
Read the rem equivalent
At the default 16-pixel base, 24px works out to 1.5rem. If your project uses a different html font-size, set the base accordingly so the math matches your CSS.
Run the conversion in reverse
Need pixels from rem? Enter the rem value and the tool computes the equivalent pixel size. The same field handles both directions.
Drop the result into your stylesheet
Use rem for font sizes and major spacing where accessibility matters, and reserve pixels for things like one-pixel borders that genuinely shouldn't scale.
When to Use PX to REM Converter
Building responsive, scalable layouts
Modern frontend work expresses font sizes and major spacing in rem rather than pixels because rem scales with the user's chosen text size. Translating a Figma spec from pixels to rem (16px to 1rem, 24px to 1.5rem at the default base) is one of those small steps that gets repeated throughout a project, and having an instant calculator beats opening the dev tools console for every value.
Meeting accessibility requirements
Users with visual impairments often increase their browser's default text size. Pixels ignore that preference; rem respects it. Converting a px-heavy stylesheet to rem-based sizing is one of the practical steps toward WCAG compliance, and it matters disproportionately for government, healthcare, and educational sites that serve diverse audiences.
Establishing a design system spacing scale
Design systems usually pin a base unit (16px is most common) and derive a spacing scale from there. The converter is handy for filling in the scale — translating 4, 8, 12, 16, 24, 32 px into 0.25, 0.5, 0.75, 1, 1.5, 2 rem — and for sanity-checking that the typography ramp matches the underlying base.
Modernizing legacy stylesheets
Old CSS files riddled with hard-coded pixel values become accessible (and easier to maintain) once they're rewritten in rem. Bulk-converting a stylesheet by hand is tedious; running the values through a converter accelerates the cleanup and reduces the chance of arithmetic mistakes during the refactor.
PX to REM Converter Examples
Default base, standard value
16px at the default 16px base1rem (16 divided by 16 equals 1)Modern browsers ship with html { font-size: 16px } as their default, so 1rem reads as 16 pixels right out of the box. Users can adjust this in their browser preferences, and rem-based sizes will respond to that preference automatically.
Custom 18px base
html font-size set to 18px16px is about 0.889rem, 24px is about 1.333rem, 32px is about 1.778remSome designs intentionally bump the base to 18 or 20 pixels for a roomier reading experience. Once you change the base, every rem calculation rebases against the new value, which is why specifying the base matters whenever it's not the default.
Bulk conversion of a stylesheet
A list of pixel valuesEach value converted to rem at the chosen base, ready to paste back into CSSUseful when modernizing legacy stylesheets or filling out a design system spacing scale. Running a batch through the converter avoids the per-value mental arithmetic and reduces the chance of typos during a refactor.
Tips & Best Practices for PX to REM Converter
- 1.Stick with the 16px default base unless you have a deliberate reason to change it. Browser vendors picked the value because it reads well across typical displays, and overriding it complicates every accessibility tool that assumes the default.
- 2.Use rem for font sizes, full stop. Pixel-based fonts ignore the user's text-size preference, which is a real accessibility regression for readers with low vision.
- 3.Em and rem aren't interchangeable. Em is relative to the element's own font size and compounds through nesting, while rem is always relative to the root. Rem behaves more predictably and is the safer default for layout work.
- 4.A few conversions are worth memorizing. 1rem is 16px, 1.25rem is 20px, 1.5rem is 24px, and 2rem is 32px. That handful covers the bulk of everyday spacing decisions.
- 5.Mixing units is fine when there's a reason. Rem suits typography and major spacing; pixels still make sense for hairline borders where you genuinely want a one-pixel line regardless of zoom level.
- 6.Compounded em values can surprise you. A 1.2em on a parent plus 1.2em on a child produces 1.44em effective sizing because the child inherits the parent's computed size. Rem sidesteps the cascade entirely and avoids this class of bug.
Frequently Asked Questions
Related Tools
Font Size Calculator
Calculate ideal responsive font sizes based on viewport width and base size. Free font size calculator with px, rem, em conversion and WCAG compliance.
Temperature Converter
Convert between Celsius, Fahrenheit, and Kelvin online. Free temperature converter with instant results and conversion formulas.
Length Converter
Convert between meters, feet, inches, miles, and more length units online. Free length converter with instant accurate results.
Weight Converter
Convert between kilograms, pounds, ounces, grams, and more weight units online. Free mass converter with instant calculations.
Area Converter
Convert between square meters, square feet, acres, hectares, and more area units online. Free area converter with precision.
Volume Converter
Convert between liters, gallons, cups, milliliters, and more volume units online. Free volume converter with instant results.