PX ↔ REM Converter
Convert CSS pixels and rem units instantly, with a configurable base font size (root).
Most browsers use 16px as the default root font size.
Tip: use this when designing responsive typography and spacing.
What is a px to rem converter?
A px↔rem converter helps developers translate CSS pixel values into rem units (and back) based on a chosen base font size. Rem units are relative to the root font size and can improve accessibility and scalability. This tool is browser-based, instant, and perfect for design systems, refactors, and quick checks during UI development.
How to use
- Enter a value (px or rem).
- Select the “From” unit and the “To” unit.
- Set the base font size (commonly 16px).
- Copy the result for your CSS.
Common use cases
- Migrating legacy CSS: px spacing → rem tokens.
- Design systems: validate typography scale and spacing rules.
- Responsive UI: ensure consistent scaling across devices.
FAQ
What base font size should I use?
If you don’t know, start with 16px. If your project sets html { font-size: ... }, use that value.
Is rem always based on 16px?
No. 16px is the typical browser default, but projects can override it.
Does this support em?
This page focuses on px and rem. Em depends on the current element’s font size, so it’s context-specific.