Skip to content
Type & Text

PX to REM Converter

Convert px to rem and rem to px against any root font size, with a quick reference table of common pixel values.

  • #px to rem
  • #rem to px
  • #tailwind rem
  • #css
  • #px
  • #rem
  • #units
  • #font size
  • #typography
100% client-side

Runs in your browser. Your data never leaves this device.

The Workbench
PX to REM Converter — workspaceLive
Base font size
px
px
rem
pxrem (base 16px)
Network requests0
Bytes uploaded0
Trackers fired0
The Guide

About PX to REM Converter

/01 Pixels, rem and why the conversion matters

A rem is always measured against the root font size — the size set on the html element, which browsers default to 16px. So 24px equals 1.5rem at that default, but only 1.2rem if a user has bumped their browser text up to 20px. That is the whole point of rem: sizes scale with the reader's own setting instead of ignoring it.

Enter a pixel value and this converter gives you the rem equivalent instantly, and it works in reverse when you have a rem figure and need to know what it renders as. Change the root size and every result recalculates.

/02 Where to use rem and where px still wins

Font sizes, spacing, max-widths and media query breakpoints are all better in rem, because they respect the reader's zoom and accessibility settings. Borders, hairlines and anything that should stay physically crisp are usually fine left in px.

A common workflow is to design in pixels — because that is what design tools speak — then convert the values as you write the CSS. Doing it here keeps the arithmetic out of your head and out of your stylesheet.

/03 px to rem in Tailwind, Figma and everyday CSS

Design tools such as Figma measure everything in pixels, while good CSS sizes type and spacing in rem. Converting px to rem is dividing by the root font size, which is 16 pixels unless someone has changed it. The values you will use most are worth memorising: 12px is 0.75rem, 14px is 0.875rem, 18px is 1.125rem, 20px is 1.25rem, 24px is 1.5rem, 32px is 2rem, 40px is 2.5rem and 48px is 3rem.

Tailwind CSS is built on the same arithmetic. Its spacing scale moves in steps of 0.25rem, which is 4px at the default root, so p-4 is 1rem or 16px and gap-6 is 1.5rem or 24px. Font sizes follow rem as well: text-sm is 0.875rem and text-lg is 1.125rem. When a design hands you 20px of padding, that is 1.25rem, or p-5 in Tailwind.

FAQ

Questions about PX to REM Converter.

What root font size should I use?
Leave it at 16px unless you have a strong reason not to. That is the browser default, and overriding it on html (the old 62.5% trick) means every rem value in your project is relative to a number your users did not choose.
Should I use rem or em?
Rem is relative to the root, em is relative to the parent element's font size. Rem is predictable and is the right default; em is useful when you deliberately want a value to scale with its immediate context, such as padding inside a button that grows with the button's own text.
Do the conversions round?
Results are shown at a sensible precision rather than dumping a long float into your stylesheet. Values like 0.9375rem are exact; anything longer is trimmed to a length that renders identically.
How many pixels is 1.5rem?
24px, when the root font size is the browser default of 16px. The formula is rem × 16, so 1.25rem is 20px and 0.875rem is 14px.
What is 16px in rem?
1rem at the default root size. Divide pixels by 16 to convert: 8px is 0.5rem, 24px is 1.5rem and 40px is 2.5rem.
How do rem values map to Tailwind classes?
Tailwind's spacing scale steps in 0.25rem, which is 4px at the default root, so p-4 is 1rem (16px) and gap-6 is 1.5rem (24px). Text sizes follow rem too: text-sm is 0.875rem (14px) and text-lg is 1.125rem (18px).
Related
Line Height Calculator

Line height calculator: get readable line heights for any font size as a unitless ratio, pixels or percent, with a live preview.

line height calculatorcss line heightleading calculator
Typography Calculator

Convert points to mm, inches, picas, ciceros, agates, pixels and rem, for print and screen typography, with a quick reference.

points to mmpt to pxpica to inches
Glyph Browser

Browse and copy Unicode characters: symbols, arrows, currency, maths, emoji and more, searchable by name or code point.

unicode charactersspecial characterssymbols copy paste
Word Counter

Free online word counter for words, characters, sentences and paragraphs, with reading and speaking time, updated as you type.

word countercharacter counterspeaking time
Large Type

Show big text on your screen: blow a short password, code or message up to read across a room, with look-alike characters colour-coded.

big textlarge text displayshow text on screen
Text Editor

Free online text editor for Markdown with live formatting, tables, footnotes, focus mode, and export to Markdown, HTML or PDF.

online text editormarkdown editor onlinedistraction free writing
Text Scratchpad

Online notepad that saves in your browser, with tools to change case, sort, remove duplicates, find and replace, and clean up text.

online notepadtext case converterremove duplicate lines
Font File Explorer

Online font viewer: open a TTF, OTF, WOFF or WOFF2 file to preview it at any size with your own text and get ready-to-use CSS, without installing it.

font viewerttf viewerotf viewer
Shavian Transliterator

Shavian alphabet transliterator: convert English text into Shavian script, with alternate spellings for words pronounced more than one way.

shavian alphabetenglish to shavianshavian translator
Text Diff

Online text compare tool: paste or open two versions and see every added and removed line highlighted side by side. Nothing is uploaded.

text comparecompare two textscompare text files