Calculator4Everyone

CSS Unit Converter

Convert between px, rem, and em for a root font size you control (default 16px). See exact values plus a reference table across a typical size range.

Category: Developer Tools

About this tool

What Is CSS Unit Converter? The CSS Unit Converter converts between px, rem, and em using a root font size you control (16px by default). The result panel shows exact px↔rem and px↔em values plus a reference table across a typical size range. How It Works Conversion applies rem = px ÷ rootSize and em = px ÷ rootSize (em is normally relative to the parent font size; the converter uses the root size as the default parent). Your root font size decides every ratio on the page. Worked Example With a 16px root size: 16px → 1rem and 1em, 24px → 1.5rem, and 0.5rem → 8px em equivalent to 0.5em at the root size. Common Use Cases tune responsive typography consistently migrate design tokens from px to rem audit existing styles for unit consistency Important Notes em compounds with every nested parent, while rem always references the root size changing the root font size updates every conversion and the full table instantly negative values convert by the same formula Related Tools CSS Validator — validate CSS style sheets. HTML Validator — validate HTML markup. JSON Formatter — format, validate, and minify JSON. HTML Minifier — compress HTML markup. XML Formatter — format and validate XML documents. Frequently Asked Questions What is the difference between rem and em? rem always refers to the document root font size; em refers to the parent element's font size and compounds with nesting. W

Browse all tools — Browse categories