CSS Unit Converter
Type a pixel amount in the Pixels field and your document root size in Root font-size (px)—defaults are 16 and 16—then click Convert. The result panel shows px, rem, em, and pt values together with the root used.
Click Convert.
About this tool
rem and em divide pixels by the root font-size; pt uses the standard 0.75 multiplier (1px = 0.75pt). The tool rejects non-numeric px input and root values that are zero or negative, showing clear error messages instead of partial output.
How to use
- Open the converter: Load the page and find the Pixels input, Root font-size input, and Convert button.
- Enter pixel value: Type the CSS pixel size you want to convert, such as the default 16.
- Set root font-size: Enter the html root size in px—16 is typical for most sites.
- Click Convert: Press Convert and copy the combined px, rem, em, and pt line from the result div.
Common use cases
- Translate a design spec from px to rem before updating a component library.
- Check how a 14px label scales when the html root is 18px instead of 16px.
- Convert px values to pt for print stylesheet snippets.
- Compare rem and em side by side—they match here because no local font-size is set.
Tips
- Root font-size must be a positive number; zero or invalid values show Root font-size must be > 0.
- rem and em outputs share the same number when converting from px with a single root baseline.
FAQ
Why do rem and em match in the output?
With no nested font-size, em equals rem when dividing px by the root value.
What if Pixels is not a number?
Convert shows Enter a valid px number and leaves the previous result unchanged.
How is pt calculated?
pt = px × 0.75, the common CSS print conversion factor shown in the output.
Does Convert send data online?
No. Math runs locally in your browser when you click Convert.