Home › Programmer & Developer Tools › CSS px ↔ rem/em Converter

CSS px ↔ rem/em Converter

Convert CSS units between px, rem, and em at any root font size, in both directions. Includes a quick-reference table of common pixel values — exact math, computed live in your browser.

How to use CSS px ↔ rem/em Converter

  1. Set your root font size (default 16px).
  2. Enter a value and pick its unit to see the equivalents.
  3. Copy any result, or grab values from the reference table.

Frequently asked questions

What root font size should I use?
Most browsers default to 16px, so 1rem = 16px. Change the root value if your project sets a different base font size on the html element.
What is the difference between rem and em?
rem is always relative to the root font size, while em is relative to the current element’s font size. This tool converts both against the root value you choose.

More Programmer & Developer Tools

  • JSON Validator — Validate, parse, and prettify JSON — load it from a URL or curl command, or convert a Python dict (single quotes, True/False/None) to JSON. Identifies syntax errors with precise line number reporting.
  • Code Beautifier — Automatically format your JavaScript, CSS, and HTML with customizable indentation and style rules.
  • Minifier — Reduce bundle sizes by removing whitespace, comments, and optimizing code structure for production.
  • SQL Formatter & Beautifier — Pretty-print and indent SQL queries across dialects (PostgreSQL, MySQL, T-SQL, BigQuery, and more) with configurable keyword casing.
  • XML Formatter — Beautify and validate XML with configurable indentation, or minify it to the smallest valid output — entirely in your browser.
  • JSON Diff — Compare two JSON objects (or Python dicts) structurally to spot added, removed, and changed keys — or switch to line and word mode for plain text and code.
  • RegEx Tester — Build and test regular expressions in real-time with syntax highlighting and match group visualization.
  • Base64 Converter — Quickly encode and decode strings or files to Base64 format for safe data transmission.