PX to REM Converter
Convert pixels to REM and EM units (and back) with a custom root font size. Includes a two-way single-value converter and a batch mode for pasting multiple values at once. All calculations happen in your browser.
How to use
- 1
Set your root font size
Enter your html element's font-size (default 16px). All conversions update against this value.
- 2
Single value — two-way
Type in either the PX or REM field — the other updates instantly. Use the swap button to flip values between fields. EM is shown as a read-only reference.
- 3
Batch — paste many values
Switch to the Batch tab and paste one value per line. Bare numbers are treated as px; suffix with px, rem or em to be explicit. Results appear in a sortable table.
- 4
Quick reference — common sizes
Switch to the Quick reference tab for a pre-computed table of 8, 12, 14, 16, 18, 20, 24, 32, 48 and 64 px — the sizes most commonly used in design systems.
Common use cases
- Convert a Figma pixel spec to REM units for an accessible, scalable stylesheet.
- Audit a CSS file to confirm type-scale values land on sensible REM increments.
- Quickly look up the REM equivalent of common pixel sizes (16, 24, 32) without breaking out a calculator.
- Migrate a legacy px-based stylesheet to REM units in bulk via the batch converter.
Limitations
- EM is contextual — it's relative to the parent element's font size, not the root. This tool assumes the parent's font size equals the root, which is true for top-level typography but not for nested elements. Always verify EM values in context.
- The batch converter only accepts a single numeric value per line (optionally suffixed with
px,remorem). Compound values like16px 24pxare not supported. - Root font sizes below 1px are clamped to 1px to avoid division-by-zero nonsense.
Frequently asked questions
Related tools
View allColor Shade Generator
Generate lighter and darker shades of a colour.
Color Picker
Pick colours and convert between HEX, RGB, HSL.
CSS Gradient Generator
Build linear and radial CSS gradients visually.
Contrast Checker
Check WCAG colour contrast between two colours.