PX to EM / REM Converter

Convert between CSS units: px, em, rem, pt, %, vw, and ch. Includes type scale ratios, quick reference table, and live size preview.

PX to EM / REM Converter

Browser default is 16px — used for rem
Used for em — inherits from parent element
For vw calculation (e.g. 1440 for desktop)
Pixels
16.00px
Absolute screen pixels
EM
1.0000em
Relative to parent (16px)
REM
1.0000rem
Relative to root (16px)
Points
12.00pt
1pt = 1.333px (print)
Percent
100.00%
Relative to parent font size
Viewport Width
1.1111vw
At 1440px viewport
ch
2.00ch
Approx. width of '0' character
CSS snippet:
font-size: 1.0000rem; /* 16px at 16px root */

Quick PX ↔ REM Reference (base: 16px)

PXREMEM (parent 16px)PT
8px0.5rem0.5em6pt
10px0.625rem0.625em7.5pt
11px0.6875rem0.6875em8.3pt
12px0.75rem0.75em9pt
13px0.8125rem0.8125em9.8pt
14px0.875rem0.875em10.5pt
16px1rem1em12pt
18px1.125rem1.125em13.5pt
20px1.25rem1.25em15pt
24px1.5rem1.5em18pt
28px1.75rem1.75em21pt
32px2rem2em24pt
36px2.25rem2.25em27pt
40px2.5rem2.5em30pt
48px3rem3em36pt
56px3.5rem3.5em42pt
64px4rem4em48pt
72px4.5rem4.5em54pt
80px5rem5em60pt
96px6rem6em72pt

Type Scale Ratios

ScaleRatioh4h3h2h1
Minor Second1.06717px18px19px21px
Major Second1.12518px20px23px26px
Minor Third1.219px23px28px33px
Major Third1.2520px25px31px39px
Perfect Fourth1.33321px28px38px51px
Augmented Fourth1.41423px32px45px64px
Perfect Fifth1.524px36px54px81px
Golden Ratio1.61826px42px68px110px

Size Preview

The quick brown fox jumps over the lazy dog
Rendered at 16.0px (1.000rem)
Planning notes, formulas, and examples

About the PX to EM / REM Converter

CSS offers multiple unit systems for sizing — pixels (px) for absolute sizing, em for parent-relative sizing, rem for root-relative sizing, vw for viewport-relative sizing, and more. Choosing the right unit affects accessibility, responsiveness, and maintainability. The most common pain point is converting between px (what designers specify) and rem/em (what accessible CSS should use).

This converter handles all major CSS length units with full context: base font size (for rem), parent font size (for em), and viewport width (for vw). It generates ready-to-paste CSS snippets, a comprehensive quick-reference table for the 20 most common sizes, a type scale ratio explorer for harmonious heading hierarchies, and a live text size preview.

If you're building responsive layouts, migrating a design system from px to rem, or simply need to know what 14px is in rem with an 18px base font, this calculator gives you instant answers with the surrounding context that designers and developers need.

When This Page Helps

Design tools give sizes in pixels, but modern CSS should use rem for accessibility. This converter bridges that gap with instant bidirectional conversion, contextual CSS snippets, and a comprehensive reference table — saving trips to your browser's dev tools. Use it when you're translating a design system to scalable CSS and need root, parent, and viewport context in one place.

How to Use the Inputs

  1. Select conversion direction: PX→EM/REM, EM→PX, or REM→PX.
  2. Enter your value or click a preset for common sizes.
  3. Set the root font size (default 16px) — this is the browser default used for rem.
  4. Set the parent font size if different from root — this is used for em calculations.
  5. Enter the viewport width for vw calculations (e.g. 1440 for desktop).
  6. Read all equivalent units, copy the CSS snippet, and use the reference tables.
  7. Explore type scale ratios to build harmonious heading hierarchies.
Formula used
rem = px ÷ root_font_size em = px ÷ parent_font_size pt = px × 0.75 % = (px ÷ parent_font_size) × 100 vw = (px ÷ viewport_width) × 100 Reverse: px = rem × root_font_size or px = em × parent_font_size

Example Calculation

Result: 1.5rem = 1.5em

24px ÷ 16px = 1.5. With root and parent both at 16px, rem and em are equal. In points: 24 × 0.75 = 18pt.

Tips & Best Practices

  • Set your CSS html { font-size: 100% } (not a px value) so rem respects the user's browser font size.
  • For responsive typography, use clamp(): clamp(1rem, 2.5vw, 2rem) scales between 1rem and 2rem.
  • A popular shortcut: set html { font-size: 62.5% } to make 1rem = 10px (for easy mental math), but this overrides user preferences.
  • Em is useful for component-level scaling — padding: 0.5em scales proportionally when the component's font size changes.
  • The "Perfect Fourth" scale (1.333) is the most commonly used type scale for web design.

CSS Unit Overview

| Unit | Relative to | Best for | |---|---|---| | px | Screen pixel | Borders, shadows, icons | | rem | Root font size | Font sizes, spacing, layout | | em | Parent font size | Component-internal spacing | | % | Parent dimension | Widths, fluid layouts | | vw/vh | Viewport | Full-bleed sections, hero text | | ch | "0" width | Input field widths |

Accessibility and rem

Users with low vision may increase their browser's default font size from 16px to 20px or more. Layouts sized in rem scale correctly; layouts in px do not. WCAG 2.1 Success Criterion 1.4.4 requires text to be resizable to 200% without loss of content — rem-based typography passes automatically.

Building a Type Scale

A type scale applies a consistent multiplier between heading levels. Starting from a 16px base with a Major Third ratio (1.25): body = 16px, h4 = 20px, h3 = 25px, h2 = 31.25px, h1 = 39px. This creates visual harmony similar to musical intervals — which is why the ratios are named after musical intervals.

Sources & Methodology

Last updated:

Frequently Asked Questions

  • rem is relative to the root (<html>) font size, em is relative to the parent element font size. rem is predictable everywhere; em compounds — 1.5em inside another 1.5em element gives 2.25× the root size.