PX to REM Converter: CSS Units, VW, VH & Tailwind
Convert px and rem with custom root, element, and viewport sizes plus em, %, pt, vw, vh, Tailwind references, CSS snippets, and history.
Default browser root is 16px.
CSS:
font-size: 1rem;Convert to all units
REM (rem)1
EM (em)1
Percent (%)100
Points (pt)12
Picas (pc)1
Inches (in)0.1667
Centimeters (cm)0.4233
Millimeters (mm)4.2333
Viewport width (vw)0.8333
Viewport height (vh)1.4815
Tailwind spacing (root 16px)
| rem | px | Copy |
|---|---|---|
| 0.5rem | 8px | |
| 1rem | 16px | |
| 1.5rem | 24px | |
| 2rem | 32px | |
| 2.5rem | 40px | |
| 3rem | 48px | |
| 3.5rem | 56px | |
| 4rem | 64px | |
| 5rem | 80px | |
| 6rem | 96px | |
| 8rem | 128px | |
| 10rem | 160px | |
| 12rem | 192px | |
| 14rem | 224px | |
| 16rem | 256px | |
| 20rem | 320px | |
| 24rem | 384px |
Tailwind breakpoints (root 16px)
| Name | rem | px |
|---|---|---|
| sm | 40rem | 640px |
| md | 48rem | 768px |
| lg | 64rem | 1024px |
| xl | 80rem | 1280px |
| 2xl | 96rem | 1536px |
Common font sizes (root 16px)
| px | rem |
|---|---|
| 8px | 0.5rem |
| 10px | 0.625rem |
| 12px | 0.75rem |
| 14px | 0.875rem |
| 16px | 1rem |
| 18px | 1.125rem |
| 20px | 1.25rem |
| 24px | 1.5rem |
| 32px | 2rem |
| 40px | 2.5rem |
| 48px | 3rem |
| 64px | 4rem |
| 96px | 6rem |
| 128px | 8rem |
History
No saved conversions yet.
PX to REM converter features
- Convert px and rem in either direction with a configurable root size
- Compare rem, em, %, pt, pc, in, cm, mm, vw, and vh in one live grid
- Set element font size and viewport dimensions for context-aware results
- Use precision controls, root presets, swap/reset, copy buttons, and CSS snippets
- Reference Tailwind spacing, breakpoints, and common typography sizes
- Save recent conversions locally with explicit validation for invalid roots
PX to REM converter FAQ
How is a pixel value converted to rem?
Divide the pixel value by the root font size. For example, 32px ÷ 16px = 2rem. Change the root input when your design system uses a different html font size.
What is the difference between rem and em?
rem is relative to the root element's font size, while em is relative to the element's computed font size or inherited parent context. This converter lets you supply both root and element sizes.
How are vw and vh calculated?
vw is a percentage of viewport width and vh is a percentage of viewport height. Enter the viewport dimensions to make those results match your target layout.