Rems to Pixels Converter (REM ↔ PX)
CSS & responsive designProfessional rems to pixels converter for front-end developers and designers. Convert rem to px and px to rem with a customizable base font size, presets for common root sizes, live CSS snippet and a reference table.
Tip: keep everything in rem in your CSS and use this tool only when you
need to sanity-check visual sizes or communicate values in pixels.
REM ↔ PX with custom base font size
Typically the html font-size. Default browser value is 16 px.
Enter a value in rem to get the equivalent pixels.
Or enter pixels to get the equivalent rem value.
Applied to both REM and PX outputs.
px = rem × base | rem = px ÷ base
Common REM → PX conversions (based on current base)
Table updates when you change the base font size.| REM | PX (current base) | Use case |
|---|
Understanding rems and pixels in modern CSS
The rem (root em) unit is one of the most useful tools for building scalable,
accessible interfaces. Unlike em, which is relative to the font-size of the current
element, rem is always relative to the root element (html) font-size.
Most browsers ship with html { font-size: 16px; }. If you do not override this value,
then:
- 1 rem = 16 px
- 0.875 rem ≈ 14 px
- 1.5 rem = 24 px
- 2 rem = 32 px
Core formulas used by this converter
Given base font size B in pixels:
px = rem × B
rem = px ÷ B
Example (B = 16): 1.5 rem × 16 = 24 px. Conversely, 24 px ÷ 16 = 1.5 rem.
Why many teams prefer rem for type and spacing
When you size text, margins and paddings in rem units, your layout responds cleanly to user font-size preferences and global scaling:
- Changing
html { font-size }scales the entire typographic system. - Users who prefer larger basal text (e.g., 18 px instead of 16 px) see all rem-based elements scale up accordingly.
- Design tokens become easier: you can define a scale like 0.75, 0.875, 1, 1.125, 1.25, 1.5, 2 rem and never think in pixels.
The “62.5% trick” and when to use it
Some codebases set html { font-size: 62.5%; }, which turns 16 px × 0.625 into 10 px.
This means:
- 1 rem = 10 px
- 1.6 rem = 16 px
- 2.4 rem = 24 px
This mapping makes mental math convenient (1 rem = 10 px), but it can also conflict with user font-size expectations. Many teams now prefer to keep the root at 16 px and work directly with a rem-based type scale.
FAQ: rems, pixels and this converter
Is using pixels always “bad” for accessibility?
Not necessarily. Pixels are perfectly valid for small details such as borders, icons or shadows. The key is to avoid hard-coding everything in pixels, especially large blocks of text, because this can make it harder for users to scale content comfortably.
How do media queries interact with rem?
Media queries operate in CSS pixels (or other viewport units), independent of rem. A common pattern is to define breakpoints in px (e.g. 768 px, 1024 px) and use rem inside each breakpoint for typography and spacing.
How does this tool differ from simple one-direction calculators?
This calculator:
- Supports bidirectional conversion (REM → PX and PX → REM).
- Lets you change the base font size at any time.
- Shows a live CSS snippet you can copy into your stylesheet or design system.
- Updates a quick reference table to keep mental models aligned with your chosen scale.