Loona Automation logoLoona Developer Tools
Home › CSS Tools

PX to EM Converter

In short: convert px to em against any base font size (16px by default) — with a ready table of the common values at your base.
🔒 Private by design: everything runs in your browser on this device. Your input is never uploaded to a server.

About

em is relative to the CURRENT element's font size, which compounds through nesting — the property that makes em powerful for component-internal spacing (padding that scales with the component's own text) and treacherous for font-size itself. This converter uses the parent font size you supply as the base; check what the parent actually computes to before trusting it deep in a tree.

Frequently Asked Questions

Why is the default base 16?

Every major browser ships with a 16px default root font size; designs and frameworks (Tailwind's spacing scale among them) assume it unless the user or the CSS changes it.

Should I use px or relative units?

Relative units (rem for layout, em for component internals) respect user font preferences — an accessibility requirement in most guidelines. px survives for hairline borders and fixed media.

Related Developer Tools

Embed this tool on your website — free

Add this tool to your own website or blog — it is completely free, needs no sign-up, and always shows the latest version. Copy the code below and paste it into your page where you want the tool to appear. Keeping the small “Powered by Loona Automation” credit line under the embed helps keep this tool free — but you are free to style or remove it; the tool works either way.