What is the PX to REM Converter?
Convert pixel values to rem units based on your root font-size. See a bulk conversion table and copy individual values instantly.
Everything runs locally in your browser. Adjust the controls above, preview instantly, and copy clean, production-ready CSS — no account, no upload.
Using the PX to REM Converter
Everything lives in the panel at the top of this page. There is nothing to install — it all runs right here in your browser.
Set root font-size
The default browser root font-size is 16px. Most projects keep this. If your project sets html { font-size: 62.5% }, the effective root is 10px.
Enter pixel values
Type a pixel value to see its rem equivalent. Or use the bulk table to see common pixel values (8px to 64px) converted at a glance.
Copy the rem value
Click a value in the table to copy it to the clipboard.
What the generated code looks like
Clean, production-ready CSS — no vendor bloat, no unnecessary declarations.
/* Root font-size: 16px */
/* Formula: rem = px / root-font-size */
h1 { font-size: 2rem; } /* 32px */
h2 { font-size: 1.5rem; } /* 24px */
h3 { font-size: 1.25rem; } /* 20px */
p { font-size: 1rem; } /* 16px */
.small { font-size: 0.875rem; } /* 14px */
.tiny { font-size: 0.75rem; } /* 12px */
.card { padding: 1.5rem; } /* 24px */
.hero { padding: 3rem 4rem; } /* 48px 64px */Common mistakes & how to fix them
A few habits trip people up. Here is what to watch for — and the exact fix.
Using px for font-size instead of rem
Pixel font sizes override the user's browser font size setting. Users who set their browser to 20px for accessibility will still see 16px text if font-size is in px.
Fix: Use rem for font-size. The cascade from the browser root font-size allows user preferences to scale all text proportionally.
Pro tips for better results
Use rem for font-size and spacing, px for borders
rem ensures typography and spacing scale with user font preferences. px is appropriate for borders (1px border should stay 1px regardless of font zoom) and small fixed decorative elements.
Frequently asked questions
From the blog
Read more →Modern CSS techniques every developer should know
A practical tour of the CSS features that replaced yesterday’s hacks.
From design to code without the friction
How visual generators speed up the build without sacrificing clean output.
Writing CSS that scales with your project
Tokens, naming, and structure that keep large stylesheets maintainable.