Esta página aún no está traducida al español, así que la mostramos en inglés.

PX to REM Converter

Convert between pixels, rem and em with your own root font size — or paste a whole stylesheet and convert every px value in one go.

Actualizado el
The html font size — 16px in every browser by default.
em is relative to the element’s own/parent font size.
px
rem
em

Common sizes at a 16px root

Convert a CSS snippet

CSS with rem
Strings, url() and comments are left untouched.

Tus datos nunca salen de tu ordenador. Todo se procesa localmente en tu navegador.

Cómo usar: PX to REM Converter

  1. Set the root font size (leave 16 unless your site changes the html font size).
  2. Type a value into Pixels, REM or EM — the other fields update instantly.
  3. Use the common sizes table to copy frequently used rem values with one click.
  4. To convert a whole stylesheet, paste it into Your CSS, choose the options and copy the result.

What is a rem?

rem stands for “root em”: 1rem equals the font size of the root <html> element. Browsers default that to 16px, so 1.5rem = 24px. The key difference from pixels is that rem respects the user’s browser font-size preference — someone who sets their default to 20px gets proportionally larger text and spacing, which a fixed px value would ignore.

The conversion formula

rem = px ÷ root font size and px = rem × root font size. With the default 16px root: 12px = 0.75rem, 14px = 0.875rem, 18px = 1.125rem, 32px = 2rem. em uses the same maths but divides by the font size of the element itself (for font-size, its parent), so ems compound when nested.

UnitRelative toBest for
pxNothing — fixedHairline borders, shadows, tiny details
remRoot (html) font sizeFont sizes, spacing, layout widths
emCurrent element’s font sizePadding that scales with a button’s text, icon sizes, media queries

Converting a whole CSS file

The snippet converter finds every number followed by px and divides it by your base, while skipping comments, quoted strings and url(…) paths (so bg-16px.png survives). 1px values are kept by default because borders should stay crisp. Inside media queries, rem and em are always based on the browser’s default font size (normally 16px), not on your html rule — tick Leave @media queries unchanged if your base differs.

The 62.5% trick — and why to avoid it

Setting html { font-size: 62.5%; } makes 1rem = 10px for easy maths, but every component then needs explicit font sizes and third-party widgets render tiny. Keeping the 16px default and using a converter like this one is simpler and safer.

rem in Webflow

Webflow’s unit dropdowns support rem and em, and you can type 1.5rem straight into a field. Note that a font size set on Webflow’s Body (All Pages) tag affects inherited text and em, but not rem — rem always refers to the html element. For values that scale with the screen, generate them with the clamp() Calculator.

También se busca como: px to rem, rem to px, px to em, em to px, rem calculator, pixel to rem, font size converter, root font size.

Herramientas que combinan con: PX to REM Converter

  • Convertidor de unidades — Convierte entre unidades métricas, imperiales y técnicas en diez categorías, con un conversor bidireccional y una tabla que muestra todas las unidades a la vez.
  • CSS Formatter — Turn a minified stylesheet into readable CSS with one property per line and properly nested @media blocks.
  • CSS Minifier — Paste a stylesheet to shrink it instantly.
  • Box Shadow Generator — Stack multiple shadow layers, tweak offsets, blur, spread and opacity on a live card, then copy the box-shadow or text-shadow CSS.

Preguntas frecuentes

How many pixels is 1rem?
16px in all major browsers by default, because the root font size is 16px. If a site sets html { font-size: 62.5% }, 1rem becomes 10px; if the user raises their browser font size, 1rem grows accordingly.
What is the difference between rem and em?
rem is always relative to the root html font size, so it’s predictable everywhere. em is relative to the current element’s font size, so nested ems multiply — 1.2em inside 1.2em is 1.44× the outer size.
Should I use rem or px for font sizes?
rem. It respects users’ browser font-size settings, which matters for accessibility, while zooming works with both. Pixels remain fine for borders, outlines and box-shadow offsets.
Should media queries use px, em or rem?
em or rem media queries respond to the user’s default font size, which keeps layouts from breaking when text is enlarged. Both are calculated from the browser default (usually 16px) rather than your html font-size rule.
Will the snippet converter break my CSS?
It only rewrites numbers directly followed by px, and skips comments, strings and url() values. Review the output once — especially values like 1px borders, which are kept by default.
¿Puedo instalar PX to REM Converter como aplicación web y utilizarla sin conexión?
Sí. PX to REM Converter es una aplicación web instalable (PWA): se instala desde el navegador, no se descarga desde una tienda de aplicaciones. Haz clic en «Instalar aplicación» en la parte superior de esta página en Chrome o Edge (Windows, macOS, Linux, ChromeOS) o, en Android, utiliza «Compartir» → «Añadir a la pantalla de inicio» en iPhone y iPad, o «Archivo» → «Añadir al Dock» en Safari 17+ en un Mac. A continuación, se abrirá en su propia ventana con su propio icono y, como se ejecuta íntegramente en tu navegador, seguirá funcionando sin conexión. Firefox en el ordenador de sobremesa no permite instalar aplicaciones web. Cómo funciona la instalación.

Herramientas relacionadas