PX ⇄ REM Converter
Type in either field and the other updates instantly: rem = px ÷ root font size and px = rem × root font size. The root defaults to 16px — the value every major browser ships with — and is remembered between visits if you change it. Below the converter you get a full 1–64px reference table at your chosen root, with one-click copy for each CSS value.
Conversion table: 1–64px at root 16px
| px | rem | |
|---|---|---|
| 1px | 0.0625rem | |
| 2px | 0.125rem | |
| 3px | 0.1875rem | |
| 4px | 0.25rem | |
| 5px | 0.3125rem | |
| 6px | 0.375rem | |
| 7px | 0.4375rem | |
| 8px | 0.5rem | |
| 9px | 0.5625rem | |
| 10px | 0.625rem | |
| 11px | 0.6875rem | |
| 12px | 0.75rem | |
| 13px | 0.8125rem | |
| 14px | 0.875rem | |
| 15px | 0.9375rem | |
| 16px | 1rem | |
| 17px | 1.0625rem | |
| 18px | 1.125rem | |
| 19px | 1.1875rem | |
| 20px | 1.25rem | |
| 21px | 1.3125rem | |
| 22px | 1.375rem | |
| 23px | 1.4375rem | |
| 24px | 1.5rem | |
| 25px | 1.5625rem | |
| 26px | 1.625rem | |
| 27px | 1.6875rem | |
| 28px | 1.75rem | |
| 29px | 1.8125rem | |
| 30px | 1.875rem | |
| 31px | 1.9375rem | |
| 32px | 2rem | |
| 33px | 2.0625rem | |
| 34px | 2.125rem | |
| 35px | 2.1875rem | |
| 36px | 2.25rem | |
| 37px | 2.3125rem | |
| 38px | 2.375rem | |
| 39px | 2.4375rem | |
| 40px | 2.5rem | |
| 41px | 2.5625rem | |
| 42px | 2.625rem | |
| 43px | 2.6875rem | |
| 44px | 2.75rem | |
| 45px | 2.8125rem | |
| 46px | 2.875rem | |
| 47px | 2.9375rem | |
| 48px | 3rem | |
| 49px | 3.0625rem | |
| 50px | 3.125rem | |
| 51px | 3.1875rem | |
| 52px | 3.25rem | |
| 53px | 3.3125rem | |
| 54px | 3.375rem | |
| 55px | 3.4375rem | |
| 56px | 3.5rem | |
| 57px | 3.5625rem | |
| 58px | 3.625rem | |
| 59px | 3.6875rem | |
| 60px | 3.75rem | |
| 61px | 3.8125rem | |
| 62px | 3.875rem | |
| 63px | 3.9375rem | |
| 64px | 4rem |
How to use the px ⇄ rem converter
- Enter a px value (or a rem value — the inputs are synced both ways). Comma decimals like 12,5 are accepted.
- Adjust the root font size if your project changes it (for example the 62.5% trick makes it 10px). It persists in your browser.
- Copy the bare value (0.625rem) or the full declaration (font-size: 0.625rem;).
- Open the conversion table for the full 1–64px range at your current root.
Common values at the 16px default
| px | rem | Typical use |
|---|---|---|
| 12px | 0.75rem | captions, legal text |
| 14px | 0.875rem | secondary UI text |
| 16px | 1rem | body text baseline |
| 20px | 1.25rem | lead paragraphs, h4 |
| 24px | 1.5rem | h3, large UI |
| 32px | 2rem | h2 |
| 48px | 3rem | h1, hero text |
Notice the awkward ones are missing: 13px is 0.8125rem and 15px is 0.9375rem. Design systems built on a 4px grid (12, 16, 20, 24…) produce tidy rem values at a 16px root, which is one quiet argument for sticking to the grid.
A worked accessibility example
A user with presbyopia sets their browser default from 16px to 20px — a 25% increase. On a rem-based site, your 1rem body text renders at 20px and your 2rem headings at 40px; the whole hierarchy scales proportionally and nothing else changes. On a px-based site, every font-size: 16px stays 16px — the preference does nothing, and the user has to zoom instead, which also enlarges images and can break fixed layouts. Same CSS effort, very different outcome for the person reading.
Frequently asked questions
What is the exact formula for px to rem?
rem = px ÷ root font size, where the root is the computed font-size of the html element — 16px by default in Chrome, Firefox, Safari, and Edge. Examples at the 16px default: 10px = 0.625rem, 12px = 0.75rem, 14px = 0.875rem, 18px = 1.125rem, 24px = 1.5rem, 32px = 2rem. Going the other way: px = rem × root, so 1.25rem = 20px.
Why use rem instead of px for font sizes?
Accessibility. Users with low vision often raise their browser’s default font size (Settings → Appearance in Chrome) instead of zooming. Suppose a user sets the default to 20px: text set in rem scales — 1rem becomes 20px, 1.5rem becomes 30px — while text hard-coded as font-size: 16px stays 16px, silently ignoring the user’s explicit preference. WCAG 1.4.4 requires text to be resizable up to 200%; rem-based sizing satisfies the font-size-preference path, px-based sizing does not. Browser zoom (Ctrl/Cmd +) scales both, but you don’t control which mechanism your users rely on.
What is the html { font-size: 62.5% } trick, and should I use it?
Setting the root to 62.5% of the 16px default makes 1rem = 10px, so the mental math becomes trivial: 1.6rem = 16px, 2.4rem = 24px. The tradeoffs: every third-party stylesheet and component library that assumes 1rem = 16px will render 37.5% smaller until you compensate; you must immediately reset body to 1.6rem; and the design system gains a hidden global dependency that surprises every new developer. It still respects user preferences (62.5% of 20px = 12.5px, so everything scales), but most modern teams skip it — with this converter or CSS custom properties, the arithmetic was never the hard part.
When is px actually the right unit?
Anywhere scaling with the user’s text-size preference would hurt rather than help: borders (a 1px hairline should stay a hairline at any text size), box shadows, outline widths, and usually border-radius. Media-query breakpoints are a debated case — em-based queries handle some zoom edge cases better — but px breakpoints are common and defensible. The rule of thumb: typography, spacing tied to text, and max-widths of text columns in rem; decorative geometry in px.
What is the difference between rem and em?
Identical arithmetic, different reference. rem divides by the root (html) font size — one global, predictable base. em divides by the element’s own inherited font size, so ems compound: a 1.2em element inside a 1.2em parent renders at 1.44 × the base, which is why deeply nested em sizing drifts unpredictably. Use em deliberately for things that should scale with their local context — padding inside a button, an icon next to a label — and rem for everything tied to the page-wide scale.
Why does the tool show 4 decimal places at most?
Because that is the precision where browser rendering differences stop mattering. 13px at a 16px root is exactly 0.8125rem (shown in full), while 13px at an 18px root is 0.72222…rem, which the tool rounds to 0.7222rem — a discrepancy of less than 0.0004px at typical sizes, far below the half-pixel threshold where any screen could render a difference. Trailing zeros are trimmed, so 10px shows as 0.625rem, not 0.6250rem.
Related tools
- YAML ⇄ JSON ConverterConvert YAML to JSON and JSON to YAML instantly in your browser — multi-document support, error line numbers, and copy or download output.
- JSON ⇄ CSV ConverterConvert JSON to CSV and CSV to JSON in your browser — nested objects flattened to dot-notation columns, delimiter options, and file download.
- CSS Box Shadow GeneratorDesign CSS box shadows visually with multiple layers, inset, spread, and color alpha controls — live preview and copy-ready CSS output.
- GPA to Percentage ConverterConvert a 4.0-scale GPA to a percentage and back, with the standard US letter-grade mapping (A = 4.0). Includes a full conversion table.
- Cups ⇄ Grams Converter (by Ingredient)Convert cups to grams by ingredient — flour, sugar, butter, rice, and 40+ more — with US and metric cup sizes and tablespoon equivalents.
- Gaj ⇄ Square Feet ConverterConvert gaj to square feet and square feet to gaj — 1 gaj = 9 sq ft — with plot-size tables for 50, 100, and 200 gaj and square yard equivalents.