PX to REM Converter
Free PX to REM converter with a custom root font size. Convert px, rem, em, pt, %, vw and vh both ways, see a full table, and convert whole stylesheets.
Type a value in any CSS unit and see it in px, rem, em, pt, percent, vw, vh, inches, centimetres and millimetres at once. REM is calculated as pixels divided by the root (html) font size, 16px by default in every browser; em uses the parent element's font size, and vw/vh use the viewport size you set. A reference table lists common sizes, and the bulk converter rewrites every px value in pasted CSS as rem.
Runs entirely in your browser and works offline. Nothing you enter or upload leaves your device. Free, no sign-up.
Features
- px, rem, em, pt, %, vw, vh, in, cm, mm
- Custom root, parent and viewport sizes
- Click-to-copy results
- px → rem reference table
- Bulk-convert px in CSS, keeping 1px borders and media queries if you want
- Works offline
How to use PX to REM Converter
- Set the root font size (16px unless your html element changes it).
- Enter a value and pick its unit — every other unit updates instantly.
- Click any result to copy it, or use the table for common sizes.
- To convert a stylesheet, paste CSS into the bulk converter and copy the rem version.
Frequently asked questions
How do I convert px to rem?
Divide the pixel value by the root font size. With the default 16px root, 24px ÷ 16 = 1.5rem and 14px ÷ 16 = 0.875rem. To go back, multiply: 2rem × 16 = 32px.
What is the difference between rem and em?
rem is relative to the root html element's font size, so 1rem is the same everywhere on the page. em is relative to the font size of the element's parent (or the element itself for properties other than font-size), so nested ems compound. rem is usually easier to reason about for spacing and type scales.
Why use rem instead of px?
When a user raises the default font size in their browser settings, sizes in rem scale with it while sizes in px stay fixed. Using rem for font sizes and most spacing makes a site more accessible and keeps proportions consistent.
How many pixels is a point (pt)?
CSS defines 1in = 96px = 72pt, so 1pt = 1.333px and 1px = 0.75pt. A 12pt font is 16px. These are CSS reference units; physical size on screen depends on the device.
What does setting html { font-size: 62.5% } do?
It makes the root font size 10px (62.5% of 16px), so 1rem = 10px and conversions become simple: 1.4rem = 14px. Set the root size here to 10 to match. Remember to set a readable font size back on the body.
Related tools
- CSS Minifier & Beautifier — Minify CSS with CSSO or prettify it, with a bytes and gzip savings report
- CSS Generator — Gradients, shadows, radii and glassmorphism
- Unit Converter — Length, weight, temperature, volume, data and more
- Aspect Ratio Calculator — Solve dimensions, reduce ratios and check print size
- Color Converter — HEX, RGB, HSL, OKLCH and a WCAG contrast checker