Vexelloom
VexelloomSTUDIO
CSS TYPOGRAPHY • PX ↔ REM • 16PX ROOT DEFAULT

PX to REM Converter (CSS Typography)

Convert CSS pixels (px) to accessible rem and em units—or reverse-convert rem to px—using the standard 16px browser root font-size or your project's custom base size.

Universal Unit, Pixel/DPI & CSS Converter

14 measurement categories • Bi-directional editing • Live multi-unit matrix

Screen & Print Resolution Context
Dots/Pixels per physical inch (1 in = 96 px)
Base html font-size (1rem = 16px)

16 px = 1 rem

Formula: 1 px = 0.0625 rem • 1 rem = 16 px

Decimals:
Quick Presets:

Standard Print & ID Sizes in Pixels @ 96 DPI

Click any dimension to copy

All Pixels, Print DPI & CSS Typography Units at a Glance (16 px)

Click any card to set as “To” unit
PixelsFrom

16 px

CSS rem (Root EM)To

1 rem

CSS em

1 em

Points (PostScript / CSS)

12 pt

Picas

1 pc

Inches (Print)

0.1666666667 in

Millimeters (Print)

4.233333333 mm

Centimeters (Print)

0.4233333333 cm

Twips (1/20 pt)

240 twip

How to Convert PX to REM in CSS

In CSS, 1rem equals the computed font-size of the root <html> element. Across all modern web browsers, the default root font-size is 16px. To convert any pixel value to rem, divide the pixel value by the root font-size.

Conversion Formularem = px ÷ Root Font Size (16)
Reverse Formulapx = rem × Root Font Size (16)
Worked Example24 px ÷ 16 = 1.5 rem

CSS PX to REM & Tailwind Spacing Cheat Sheet (Base 16px)

Quick reference table for frontend developers mapping design-file pixels (Figma / Sketch) to CSS rem units and Tailwind utility classes.

Pixels (px)CSS REM (Base 16px)Common CSS / Tailwind Equivalent
4 px0.25 remspacing-1 (p-1 / gap-1)
8 px0.5 remspacing-2 (p-2 / gap-2)
12 px0.75 remtext-xs (12px font / p-3)
14 px0.875 remtext-sm (Secondary UI body text)
16 px1 remtext-base (Browser default body font)
18 px1.125 remtext-lg (Lead paragraph font)
20 px1.25 remtext-xl (Card subheading)
24 px1.5 remtext-2xl (Section heading)
32 px2 remtext-3xl / spacing-8 (2rem)
48 px3 remtext-5xl (Hero display heading)
64 px4 remtext-6xl / spacing-16 (4rem)

How to Convert Figma Pixels to CSS REM Units

Step 1

Confirm Your Root Font Size

Leave the CSS Root Font Size at 16px (standard for Tailwind, Bootstrap, and browser defaults) or change it to 10px / 14px if your <html> tag overrides it.

Step 2

Enter PX or REM Value

Type your Figma pixel value into the From (px) field, or type a rem token into the To (rem) field to see its exact pixel equivalent.

Step 3

Copy for Your Stylesheet

Check "Copy with unit (rem)" to copy ready-to-paste CSS values like 1.125rem or 2.25rem directly into your CSS or Tailwind config.

Why WCAG Accessibility Requires REM Instead of Hardcoded PX

When you hardcode font sizes in pixels (such as font-size: 14px), users with low vision who change their browser’s default font size from 16px to 20px or 24px in Chrome, Safari, or Firefox settings are locked out of scaling your text. Hardcoded pixel typography ignores user preference stylesheets and fails WCAG 2.1 SC 1.4.4 (Resize Text) best practices.

By defining font-size, line-height, and container max-widths in rem units, your entire typographic hierarchy scales proportionally whenever a user adjusts their operating system or browser base font size.

Frequently Asked Questions

What is 16px in rem?

At the standard browser root font size of 16px, 16px is exactly 1rem. Similarly, 8px is 0.5rem, 12px is 0.75rem, 14px is 0.875rem, 18px is 1.125rem, 24px is 1.5rem, and 32px is 2rem.

What is the difference between rem and em in CSS?

rem ("root em") is always calculated relative to the root <html> element’s font-size, so 1.5rem is the same size everywhere on the page. em is calculated relative to the font-size of the element’s immediate parent, which can compound unpredictably when nesting lists or components.

What if my project uses the 62.5% (10px) root font-size trick?

If your stylesheet sets html { font-size: 62.5%; }, then 1rem equals 10px instead of 16px. Simply change the "CSS Root Font Size (1rem)" box above from 16 to 10, and the converter will divide all pixel values by 10 (e.g., 16px = 1.6rem, 24px = 2.4rem).

Should I use rem or px for borders and media queries?

Use rem for font-size, padding, margin, and readable content container widths (like max-width: 48rem). Hairline 1px borders and shadows are best kept in px so they stay crisp on 1x and 2x displays.

More Dedicated Unit & Print Calculators

All 14 Measurement Categories

Related Frontend Developer & Design Tools

Continue your workflow with 100% browser-local tools—no sign-up, no watermarks, and zero server uploads.