Px to Rem Converter
This px to rem converter turns pixels into rem (and back): enter a value, adjust the base size, and get rem, em, pt, percent and vw plus a table of common sizes.
Example: Value 24 · Unit of the value: px (pixels) · Root element font size (rem) 16 px · Parent element font size (em, %) 16 px · Viewport width (vw) 1,440 px → Result: 24 px = 1.5 rem. Source: W3C – CSS Values and Units Module Level 4: absolute lengths (1in = 96px = 72pt) and font-relative lengths (em, rem). Updated: .
How it is calculated
With the browser default of 16 px, 24 px is exactly 1.5 rem. The formula is rem = px / base size, and the other way round px = rem · base size.
How it is calculated
rem is relative to the font size of the root element (html), em to the font of the parent element. 1 pt is 1/72 inch and 1 px 1/96 inch, so 1 pt = 4/3 px; 12 pt equal 16 px. Percent for font size refers to the parent font. 1 vw is 1% of the viewport width. The converter first turns your value into px and from there into every other unit.
Good to know
- If a visitor enlarged the browser font size, rem values scale automatically while px stays fixed (accessibility, WCAG 1.4.4).
- If your CSS sets
html { font-size: 62.5% }, 1 rem = 10 px. Enter 10 as the base size then. - em compounds: 1.5 em inside an element with 1.5 em gives 2.25 times. rem avoids that problem.
- rem is common for spacing and font sizes, while px still makes sense for hairlines and borders.
Frequently asked questions
How do you convert px to rem?
Divide the px value by the base font size. At 16 px: 24 px / 16 = 1.5 rem.
How many px is 1 rem?
By default 16 px, because browsers preset the root font size to that. If someone changes the browser font or sets font-size on html, the value changes.
What is the difference between em and rem?
rem always refers to the root font (html), em to the font of the parent element. That is why em values can multiply in nested elements.
How many pt is 16 px?
12 pt, because 1 pt = 4/3 px. Conversely 10 pt is about 13.33 px.
Sources and legal basis
- W3C – CSS Values and Units Module Level 4: absolute lengths (1in = 96px = 72pt) and font-relative lengths (em, rem)
- MDN – CSS-Längeneinheiten (rem, em, vw)
- W3C WCAG 2.2 – Success Criterion 1.4.4 Resize Text (relative units respect the user's font size)
As of: · Editorial policy
Related tools
- Pt to mm converterPt to mm converter: 1 pt = 0.3528 mm (1/72 inch). Convert font sizes to millimeters, picas, inches and pixels at any resolution, with a size table.
- Pixels to cmConvert pixels to cm with the right resolution: pixels to cm, mm and inches, length to pixels, and the print size your photo reaches at 300 dpi.
- CSS gradient generatorBuild CSS gradients: linear, radial or conic, as many color stops as you need, angle and fallback color – live preview and CSS ready to copy.
- CSS box shadow generatorBuild CSS box shadows with sliders: multiple layers, offset, blur, spread, color with alpha, inset and presets – live preview and one-click copy of the CSS.
- CSS border radius generatorRound corners with sliders: all corners linked or each on its own, px or %, elliptical 8-value syntax – shortest CSS shorthand, live preview and copy button.
- Font pairing – heading and body font combinationsFont pairs for headings and body text with live preview, copy-ready CSS and availability on Windows, Mac, iPhone and Android – system fonts only, no web fonts.
- What is my IP address?What is my IP? See your public IPv4 or IPv6 address at once, plus approximate location, internet provider and browser details. Free, never stored.
- CSS clamp calculatorCSS clamp calculator for fluid font sizes and spacing: enter minimum and maximum values plus the viewport range and copy the finished clamp() value.
- robots.txt Generatorrobots.txt generator: pick a preset, block or allow paths, add your sitemap and exclude AI crawlers – get a ready-to-copy file with a check for common mistakes.