Pixels to em Converter

Convert pixel values to CSS em units given a base font size (default 16px).

Use the Pixels to em Converter

Convert Pixels to em

Browser default is 16px.

Batch Converter

Enter multiple px values — one per line or comma-separated.

Copied!

Summary

This tool converts pixel values to CSS em units using the formula: em = px / base font size. The browser default base font size is 16px, but you can set any custom base to match your project. Em units are relative to the parent element's font size, making them useful for scalable, accessible typography and spacing in CSS.

How it works

  1. Enter the pixel value you want to convert.
  2. Set the base font size (default 16px matches the browser default).
  3. The em value is calculated instantly using the formula: em = px / base.
  4. Copy the result or add more values to the batch list.
  5. Use the batch converter to process multiple pixel values at once.

Use cases

  • Convert a designer's pixel measurements to em for CSS stylesheets.
  • Ensure scalable typography by expressing font sizes in em units.
  • Translate fixed px padding and margin values to relative em units.
  • Build accessible layouts where text scales with user font preferences.
  • Quickly verify em calculations when reviewing or writing CSS.
  • Batch-convert a list of pixel values from a design spec to em.

Frequently Asked Questions

Last updated: 2026-07-14 · Reviewed by Nham Vu