Pixel to Em Converter
Convert between px, em, rem, pt, and percentage CSS units instantly. Adjust the base font size and view a full conversion table.
Quick Answer
With a 16px base: 1em = 1rem = 16px = 12pt = 100%. Enter any value below to convert between all CSS units.
16px1em1rem12pt100%Common Sizes (base: 16px)
| px | em / rem | pt | % |
|---|---|---|---|
| 8px | 0.5 | 6pt | 50% |
| 10px | 0.625 | 7.5pt | 62.5% |
| 12px | 0.75 | 9pt | 75% |
| 14px | 0.875 | 10.5pt | 87.5% |
| 16px | 1 | 12pt | 100% |
| 18px | 1.125 | 13.5pt | 112.5% |
| 20px | 1.25 | 15pt | 125% |
| 24px | 1.5 | 18pt | 150% |
| 28px | 1.75 | 21pt | 175% |
| 32px | 2 | 24pt | 200% |
| 36px | 2.25 | 27pt | 225% |
| 40px | 2.5 | 30pt | 250% |
| 48px | 3 | 36pt | 300% |
| 56px | 3.5 | 42pt | 350% |
| 64px | 4 | 48pt | 400% |
| 72px | 4.5 | 54pt | 450% |
| 80px | 5 | 60pt | 500% |
| 96px | 6 | 72pt | 600% |
About This Tool
The Pixel to Em Converter is an essential utility for front-end developers, UI designers, and anyone working with CSS typography and layout. It provides instant bidirectional conversion between the five most commonly used CSS length units: pixels (px), em, rem, points (pt), and percentages (%). Simply enter a value in any unit, set your base font size, and see the equivalent in all other units at a glance.
Understanding CSS Length Units
CSS offers a variety of length units, each with distinct behaviors and ideal use cases. Absolute units like pixels and points maintain a fixed size regardless of surrounding context. Relative units like em, rem, and percentage scale dynamically based on a reference value, typically the font size of a parent or root element. Understanding when and how to use each unit is fundamental to building responsive, accessible, and maintainable websites. This tool bridges the gap between these unit systems, letting you think in whichever unit feels most natural and convert to the others as needed.
Pixels: The Screen Native Unit
Pixels (px) are the most intuitive unit for screen design because they map directly to physical screen dots (though on high-DPI displays, one CSS pixel may correspond to multiple physical pixels). Designers often work in pixels because design tools like Figma and Sketch output measurements in pixels. However, using pixels exclusively in CSS can create accessibility problems, because pixel-based font sizes do not scale when users adjust their browser's default font size. This is why modern best practices recommend using rem for typography and spacing, while reserving px for borders, shadows, and other fixed-dimension properties.
Em and Rem: Relative Sizing for the Web
The em unit is relative to the computed font size of the element's parent. If a paragraph sits inside a div with font-size: 20px, then 1.5em on the paragraph equals 30px. This cascading behavior is powerful for component-level design but can become unpredictable when elements are deeply nested, since em values compound at each level. The rem (root em) unit solves this problem by always referencing the root element's font size (the html element). With a default browser font size of 16px, 1rem always equals 16px regardless of nesting depth. This predictability makes rem the preferred unit for most layout and typography work in modern CSS architectures like Tailwind CSS, which uses rem under the hood.
Points and Percentages: Special-Purpose Units
Points (pt) originate from traditional print typography, where 1 point equals exactly 1/72 of an inch. In CSS, 1pt is defined as 4/3 of a pixel (approximately 1.333px). Points are most useful in print stylesheets (@media print) where physical dimensions matter. Using points for screen styling is generally discouraged because the physical size of a point varies across different screen densities. Percentages (%) are relative to the parent element's computed value for the same property. For font-size, 100% equals the parent's font-size. For width, 100% equals the parent's content width. Percentages are essential for fluid and responsive layouts where elements need to adapt to their container size.
The Conversion Table
Below the converter, you will find a reference table showing 18 common pixel sizes converted to em, rem, pt, and percentage values based on your current base font size. This table is especially helpful when establishing a type scale for a project. For example, with a 16px base, a common heading hierarchy might use 32px (2rem) for H1, 24px (1.5rem) for H2, 20px (1.25rem) for H3, and 16px (1rem) for body text. Having these values at hand saves repeated manual calculations and reduces the chance of errors in your stylesheets. The table updates dynamically when you change the base font size, so you can instantly see how a different root size affects all your proportional values.
Practical Tips for Unit Selection
When starting a new project, establish a consistent unit strategy early. Use rem for font sizes, margins, padding, and most spacing to ensure your layout respects user accessibility preferences. Use px for borders (1px solid), box shadows, and other decorative properties where fractional scaling would create visual artifacts. Use em sparingly and intentionally, typically for component-internal spacing that should scale with the component's own font size. Use percentage for container widths in fluid layouts. This approach, combined with CSS custom properties for your base values, creates a maintainable and accessible design system that works across all screen sizes and user preferences.
Frequently Asked Questions
What is the difference between em and rem in CSS?
Why is the default base font size 16px?
When should I use px vs em vs rem vs pt vs percent?
How do I convert px to em manually?
What is a point (pt) in CSS and when is it used?
Does changing the base font size affect rem calculations?
Was this tool helpful?