01What is PX/REM Converter?
A design file hands you pixels. Your CSS probably wants rem, and now and then a layout calls for vh or vw. PX/REM Converter takes one length and shows it in all five units at once: px, rem, em, vh and vw. It follows the unit definitions in the W3C CSS Values and Units spec. A rem is a multiple of the root element's font size. A vh is one percent of the viewport height, and a vw is one percent of the viewport width. Three settings drive every number on the page. Base Font Size starts at 16px, which is the default root font size in mainstream browsers. Viewport Width and Viewport Height start at 1920 by 1080. Under the hood the tool turns your input into pixels first, then divides back out into each unit. Results are rounded to four decimal places, so long fractions stay readable. Here is a quick worked example. Type 24 with px selected and you get 1.5rem, 1.5em, 2.2222vh and 1.25vw. Change the base to 10 and type 1.5 rem instead. You now get 15px, because rem always scales with that base. Single Convert gives each result its own copy button, so you can grab 0.875rem without retyping it. Batch Convert is for spacing scales and long lists. Paste values separated by new lines, spaces, commas or semicolons. Each one can carry a unit (12px, 1.25rem, 10vw), and a bare number is read as px. Anything else, like 3pt or a property name, shows as Invalid in its row. The tool does not guess. Below the converter, a Common Values Reference table lists twenty pixel sizes from 4px to 128px at your current settings. A few honest limits. em is computed against the base font size, exactly like rem. That only matches the browser when the parent element uses the base size, and a note under the converter says so. Real em values compound through nesting, which this tool can't see. Only these five units are supported, so pt, %, ch and the newer dvh or svh units are out. The viewport numbers are also whatever you type in. They are not read from your actual browser window, so set them to the screen you are designing for. All of the arithmetic happens in the page itself, and your values never leave your machine.
Frontend developers who receive pixel specs from designers and need rem, em or viewport values for a stylesheet or design-token file. The tool runs entirely in your browser, so your data never leaves your device.
02How to use PX/REM Converter
- Under Settings, set Base Font Size (16 by default) and, for vh or vw results, Viewport Width and Viewport Height
- Pick Single Convert, type a number into Value and choose its Unit: px, rem, em, vh or vw
- Read the five results and click the copy button next to the one you need
- For a list, switch to Batch Convert and paste values separated by spaces, commas, semicolons or new lines
- Scroll to the Common Values Reference table for frequent sizes from 4px to 128px at your settings
03Worked examples
- Input:
24 px (base 16, viewport 1920x1080) - Result:
24px, 1.5rem, 1.5em, 2.2222vh, 1.25vw - The default settings. rem and em are 24 / 16.
- Input:
14 px (base 16, viewport 1920x1080) - Result:
0.875rem, 0.875em, 1.2963vh, 0.7292vw - Viewport values are rounded to four decimal places.
- Input:
1.5 rem with base font size 10 - Result:
15px, 1.5rem, 1.5em, 1.3889vh, 0.7813vw - The same 1.5rem is 24px at the default 16px base.
- Input:
50 vw with viewport 1440x900 - Result:
720px, 45rem, 45em, 80vh, 50vw - 720px is 80% of the 900px viewport height, hence 80vh.
- Input:
Batch: 12px, 1.25rem; 2em 10vw .5 3pt - Result:
12px = 0.75rem; 1.25rem = 20px; 2em = 32px; 10vw = 192px (12rem); .5 = 0.5px (0.0313rem); 3pt = Invalid - Trimmed to the px and rem columns. A bare number counts as px, and pt is not supported.
- Input:
12abc px - Result:
No result - The single converter rejects text after the number instead of reading it as 12.
04Common use cases
- Turning a Figma spec of 14px body text and 20px headings into 0.875rem and 1.25rem before writing the stylesheet
- Pasting a whole spacing scale like 4 8 12 16 24 32 into Batch Convert to build rem tokens for a design system
- Checking what 100vh works out to on a 1080px-tall screen (1080px, or 67.5rem) when sizing a hero section
- Recalculating rem values for a codebase that sets html { font-size: 62.5% }, by switching the base to 10
- Working out the vw value for a fixed 720px panel so it scales with a 1440px-wide layout (50vw)
- Spotting mistakes in a pasted list, since unsupported entries like 3pt show up as Invalid instead of a silent wrong number
05Tips
- If your project sets html { font-size: 62.5% }, set Base Font Size to 10. Otherwise every rem result will be off by a factor of 1.6.
- Batch Convert reads a value with no unit as px, so .5 becomes 0.5px (0.0313rem), not half a rem.
- Single Convert rejects trailing junk like 12abc rather than quietly reading it as 12. Clean up values copied from devtools before pasting.
- The em column assumes the parent uses the base size. Inside a component whose parent is 20px, 1em is 20px, so do that maths yourself.
- Keep font sizes in rem. Text sized in px does not follow a reader's browser font-size setting, which matters for people who enlarge text.
06Related concepts
CSS units, Viewport units, Root font size, Responsive typography.
Frequently Asked Questions
What is PX/REM Converter?
PX/REM Converter is a free, browser-based developer tool on AIDToolStack. Convert between px, rem, em, vh, vw with batch mode and reference table. It requires no installation or sign-up and works entirely in your browser.
Is PX/REM Converter free to use?
Yes. No sign-up, no fees and no usage cap.
Does PX/REM Converter store my data?
No. It runs in your browser; nothing is uploaded.