Skip to main content

PX to REM Converter

Convert pixels to rem and em for your root and parent font sizes, convert rem back to pixels, and see a reference table.

For front-end developers moving a design to relative units.

Last updatedHow we build & check our tools
Results will appear here once you enter your values.

When rem is the better unit

Use rem for font sizes, and often for spacing, so a layout scales when someone raises their browser's default text size. Pixels stay fixed regardless of that setting. This matters for readability: people who increase their default size expect text, and the space around it, to grow.

Worked example with a 16px root: 14px is 0.875rem, 16px is 1rem, 18px is 1.125rem, 32px is 2rem. Writing them as rem lets one change to the root size rescale the whole design.

  • Use em for properties that should scale with the element's own text, such as padding on a button.
  • Use rem for global type scales and layout spacing.
  • Media queries in em or rem also respond to the user's font size, in browsers that resolve them against the default size.

Things to check

The tool does arithmetic on the numbers you give it.

It cannot see your stylesheet, so if your root font size is not what you entered, the result will not match your page.

Inherited em values compound through nested elements, so an em value that works at one level can double at the next.

Sources

W3C CSS Values and Units Module Level 3, section 5.1.1 (Font-relative lengths): rem is the computed font-size of the root element; em is the computed font-size of the element, or the parent for font-size itself.

Related tools: CSS Flexbox Generator, CSS Grid Generator and Color Converter.

Frequently Asked Questions

Common questions about the PX to REM Converter

Divide the pixel value by the root font size. With the common 16px root, 24px is 24 / 16 = 1.5rem and 20px is 1.25rem. The converter uses the root size you enter, so a 10px root turns 24px into 2.4rem. The result also shows the reverse calculation, rem times root size, as a check.

From the same team

Turn your GPU into an OpenAI-compatible API endpoint

Wide Area AI routes your LLM API calls to your own hardware over a Cloudflare Tunnel — free local inference with edge caching and automatic cloud failover. Works with any OpenAI SDK.

Start routing — free

Sources & References

Web platform and protocol references

Authoritative definitions for web technologies, encodings, and data formats used by these developer tools.

Internet standards (RFCs)

Formal specifications for internet formats and protocols.