PX to REM Converter
Convert between PX, REM, EM, %, and PT units. Adjustable base font size, CSS code snippets, and a reference table. Built for responsive design and accessibility work.
Absolute unit - fixed size regardless of other elements
Relative to root (html) font size - scales consistently
Relative to parent element font size - cascading scale
Percentage of parent element size
Print unit - 1/72 inch (primarily for print stylesheets)
Base Font Size
Set your root font size to match your project configuration. All REM, EM, and % conversions are calculated based on this value.
Common: 10px (easy math), 16px (accessibility standard)
The browser default is 16px. This is the recommended size for accessibility (WCAG compliance).
CSS Code Snippets
Practical CSS examples showing how to use different units in your stylesheets. Copy and paste directly into your code.
Font Size
Set text size using different units
/* Font size examples */
h1 {
font-size: 16px; /* Absolute - fixed size */
font-size: 1rem; /* Relative to root - scales consistently */
font-size: 1em; /* Relative to parent - cascading */
font-size: 1%; /* Percentage of parent */
}Line Height
Control spacing between lines of text
/* Line height examples */
.text {
line-height: 16px;
line-height: 1rem;
line-height: 1em;
line-height: 1%;
}Margin
Space outside elements
/* Margin examples */
.card {
margin: 16px;
margin: 1rem;
margin: 1em;
}Padding
Space inside elements
/* Padding examples */
.button {
padding: 16px;
padding: 1rem;
padding: 1em;
}Gap (Flexbox/Grid)
Space between flex or grid items
/* Gap examples */
.container {
display: flex;
gap: 16px;
gap: 1rem;
gap: 1em;
}Width
Element width
/* Width examples */
.container {
width: 16px;
width: 1rem;
width: 1%;
}Max Width
Maximum element width for responsive design
/* Max width examples */
.content {
max-width: 16px;
max-width: 1rem;
}Border Radius
Rounded corners
/* Border radius examples */
.card {
border-radius: 16px;
border-radius: 1rem;
border-radius: 1em;
}Conversion Reference Table
Quick reference showing conversions from 1px to 50px across all units. Perfect for establishing design system scales.
Pixels(px) | Root EM(rem) | EM(em) | Percent(%) | Points(pt) | Actions |
|---|---|---|---|---|---|
| 1px | 0.0625rem | 0.0625em | 6.25% | 0.75pt | |
| 2px | 0.125rem | 0.125em | 12.5% | 1.5pt | |
| 3px | 0.1875rem | 0.1875em | 18.75% | 2.25pt | |
| 4px | 0.25rem | 0.25em | 25% | 3pt | |
| 5px | 0.3125rem | 0.3125em | 31.25% | 3.75pt | |
| 6px | 0.375rem | 0.375em | 37.5% | 4.5pt | |
| 7px | 0.4375rem | 0.4375em | 43.75% | 5.25pt | |
| 8px | 0.5rem | 0.5em | 50% | 6pt | |
| 9px | 0.5625rem | 0.5625em | 56.25% | 6.75pt | |
| 10px | 0.625rem | 0.625em | 62.5% | 7.5pt | |
| 11px | 0.6875rem | 0.6875em | 68.75% | 8.25pt | |
| 12px | 0.75rem | 0.75em | 75% | 9pt | |
| 13px | 0.8125rem | 0.8125em | 81.25% | 9.75pt | |
| 14px | 0.875rem | 0.875em | 87.5% | 10.5pt | |
| 15px | 0.9375rem | 0.9375em | 93.75% | 11.25pt | |
| 16px | 1rem | 1em | 100% | 12pt | |
| 17px | 1.0625rem | 1.0625em | 106.25% | 12.75pt | |
| 18px | 1.125rem | 1.125em | 112.5% | 13.5pt | |
| 19px | 1.1875rem | 1.1875em | 118.75% | 14.25pt | |
| 20px | 1.25rem | 1.25em | 125% | 15pt | |
| 21px | 1.3125rem | 1.3125em | 131.25% | 15.75pt | |
| 22px | 1.375rem | 1.375em | 137.5% | 16.5pt | |
| 23px | 1.4375rem | 1.4375em | 143.75% | 17.25pt | |
| 24px | 1.5rem | 1.5em | 150% | 18pt | |
| 25px | 1.5625rem | 1.5625em | 156.25% | 18.75pt | |
| 26px | 1.625rem | 1.625em | 162.5% | 19.5pt | |
| 27px | 1.6875rem | 1.6875em | 168.75% | 20.25pt | |
| 28px | 1.75rem | 1.75em | 175% | 21pt | |
| 29px | 1.8125rem | 1.8125em | 181.25% | 21.75pt | |
| 30px | 1.875rem | 1.875em | 187.5% | 22.5pt | |
| 31px | 1.9375rem | 1.9375em | 193.75% | 23.25pt | |
| 32px | 2rem | 2em | 200% | 24pt | |
| 33px | 2.0625rem | 2.0625em | 206.25% | 24.75pt | |
| 34px | 2.125rem | 2.125em | 212.5% | 25.5pt | |
| 35px | 2.1875rem | 2.1875em | 218.75% | 26.25pt | |
| 36px | 2.25rem | 2.25em | 225% | 27pt | |
| 37px | 2.3125rem | 2.3125em | 231.25% | 27.75pt | |
| 38px | 2.375rem | 2.375em | 237.5% | 28.5pt | |
| 39px | 2.4375rem | 2.4375em | 243.75% | 29.25pt | |
| 40px | 2.5rem | 2.5em | 250% | 30pt | |
| 41px | 2.5625rem | 2.5625em | 256.25% | 30.75pt | |
| 42px | 2.625rem | 2.625em | 262.5% | 31.5pt | |
| 43px | 2.6875rem | 2.6875em | 268.75% | 32.25pt | |
| 44px | 2.75rem | 2.75em | 275% | 33pt | |
| 45px | 2.8125rem | 2.8125em | 281.25% | 33.75pt | |
| 46px | 2.875rem | 2.875em | 287.5% | 34.5pt | |
| 47px | 2.9375rem | 2.9375em | 293.75% | 35.25pt | |
| 48px | 3rem | 3em | 300% | 36pt | |
| 49px | 3.0625rem | 3.0625em | 306.25% | 36.75pt | |
| 50px | 3.125rem | 3.125em | 312.5% | 37.5pt |
Table based on 16px base font size. Values are rounded to 4 decimal places.
How It Works
- 1
Enter Any Value
Type a value in any unit field (PX, REM, EM, %, or PT). All other units update instantly in real-time. No button to click, just immediate conversion as you type.
- 2
Adjust Base Font Size
Set your base font size (default 16px) to match your project. Choose from common presets (8, 10, 12, 14, 16, 18, 20, 24px) or enter a custom value. All conversions recalculate automatically.
- 3
Copy Values & CSS
Click the copy button next to any converted value to copy it to your clipboard. Get practical CSS code examples showing your converted values in context. Copy entire code snippets directly into your stylesheets.
- 4
Reference Table
Use the quick reference table showing conversions from 1px to 50px across all units. Perfect for establishing design system scales. Copy any row or export the entire table as CSV.
Use Cases
Responsive Typography
Convert fixed pixel font sizes to scalable REM units. Build type scales that respect user preferences and scale consistently across breakpoints. Make your typography accessible and responsive.
Design System Migration
Migrating from PX to REM in your design system? Convert spacing scales, typography, and layout values in seconds. Maintain mathematical consistency across your component library.
Accessibility Compliance
REM units honor browser font size settings, which helps meet WCAG standards. Convert PX values so users can scale your site to their preferred reading size.
CSS Framework Configuration
Configure Tailwind CSS, Bootstrap, or custom frameworks with REM-based spacing scales. Convert design tokens from PX to relative units. Create flexible, scalable design systems.
Figma to Code Workflow
Designers work in PX, developers work in REM. Paste Figma pixel values and get production-ready REM code. Copy CSS directly into your components.
Print Stylesheet Creation
Creating print stylesheets or PDFs? Convert web units to PT for proper print sizing. Ensure your content looks professional on paper with accurate physical measurements.
Frequently Asked Questions
Need Full Responsive Design Testing?
Want to test responsive layouts beyond unit conversion? Bug0 runs AI-powered tests across breakpoints - typography scales, spacing, mobile layouts, all automated.