PX to REM Converter - Responsive Font Size & CSS Unit Tool

Convert pixel values to rem and em CSS units instantly. Set your root and parent font sizes, enter a single px value for a live result, or paste a list of values to convert in bulk. Includes a common sizes reference cheat sheet.

Base Font Sizes

px

Usually 16px (browser default)

px

Inherited font size of the element

Single Value

px

REM

1

16px / 16px

1rem

EM

1

16px / 16px

1em

Bulk Converter

Presets:

10 values converted

pxremem
4px0.25rem0.25em
8px0.5rem0.5em
12px0.75rem0.75em
16px1rem1em
20px1.25rem1.25em
24px1.5rem1.5em
32px2rem2em
48px3rem3em
64px4rem4em
96px6rem6em

Common Sizes Reference

Based on root: 16px, parent: 16px

pxremem
4px0.25rem0.25em
6px0.375rem0.375em
8px0.5rem0.5em
10px0.625rem0.625em
12px0.75rem0.75em
14px0.875rem0.875em
16px1rem1em
18px1.125rem1.125em
20px1.25rem1.25em
22px1.375rem1.375em
24px1.5rem1.5em
28px1.75rem1.75em
32px2rem2em
36px2.25rem2.25em
40px2.5rem2.5em
48px3rem3em
56px3.5rem3.5em
64px4rem4em
72px4.5rem4.5em
80px5rem5em
96px6rem6em
112px7rem7em
128px8rem8em

PX to REM Converter: Responsive CSS Unit Conversion for Modern Web Design

The shift from px to rem is one of the most important practices in modern CSS. Pixel values are absolute and ignore user preferences, while rem values scale with the browser's root font size — making your typography and layout accessible to users who rely on larger text for readability.

Our converter supports single values, bulk conversion with common design system presets (Tailwind, spacing scales, type scales), and customizable root/parent sizes for any design system.

Formula
rem = px / root font size em = px / parent font size Default (root = 16px): 16px = 1rem = 1em 24px = 1.5rem = 1.5em 32px = 2rem = 2em

The core conversion formula:

When to Use rem vs em vs px

Use rem for: font-size (body, headings, labels), max-width containers, spacing between sections

Use em for: padding/margin within a component (scales with its font-size), border-radius on buttons, line-height

Use px for: borders (border: 1px solid), box-shadow blur radius, fine-grained pixel-perfect details, media query breakpoints (debated)

Design System Conversions (Tailwind CSS)

Tailwind CSS uses a 4px base spacing grid. With 16px root:
spacing-1 = 4px = 0.25rem
spacing-2 = 8px = 0.5rem
spacing-4 = 16px = 1rem
spacing-6 = 24px = 1.5rem
spacing-8 = 32px = 2rem
spacing-12 = 48px = 3rem
text-sm = 14px = 0.875rem
text-base = 16px = 1rem
text-lg = 18px = 1.125rem
text-xl = 20px = 1.25rem

Practical Examples

Typography system

  • 1.body: font-size: 1rem (16px base)
  • 2.h1: font-size: 2.25rem (36px)
  • 3.small: font-size: 0.875rem (14px)
  • 4.All scale with user browser preferences

Component spacing

  • 1.Button padding: 0.5em 1em (scales with button font size)
  • 2.Card padding: 1.5rem (fixed relative to root)
  • 3.Grid gap: 1.5rem (consistent across components)

Frequently Asked Questions

What is the difference between px, rem, and em?

px (pixels) are absolute units - 16px is always 16 pixels regardless of context. rem (root em) is relative to the root font size (usually 16px on the html element). em is relative to the font size of the current element's parent. rem is preferred for responsive design as it scales with user browser settings.

How do you convert px to rem?

Divide the pixel value by the root font size: rem = px / root font size. With the browser default of 16px: 16px = 1rem, 24px = 1.5rem, 32px = 2rem. If you change the root font size to 10px (a common technique: html { font-size: 62.5%; }), then 16px = 1.6rem.

What is the difference between rem and em?

rem (root em) is always relative to the element's font size - it doesn't change based on nesting. em is relative to the font size of the element's parent, so it compounds with nested elements. Generally, rem is more predictable and preferred for font sizes, while em is useful for things that should scale with their parent context (like padding on buttons).

Why should I use rem instead of px?

rem values respect the user's browser font size preferences. Users who set their browser to a larger font size (for accessibility) will see rem-based layouts scale correctly, while px-based layouts won't scale. This makes rem critical for accessible, responsive web design.

What is the 62.5% root font size trick?

Setting html { font-size: 62.5%; } changes the root from 16px to 10px (62.5% of 16). This makes rem arithmetic easy: 1rem = 10px, 1.6rem = 16px, 2.4rem = 24px. However, this approach can cause issues with third-party components that assume 16px root, so it's debated in the community.

What base font size should I use?

Leave the browser default at 16px unless you have a strong reason to change it. The browser default is set by the user and should be respected for accessibility. Use rem values in your CSS that assume 16px root, and let users with different font size preferences benefit from automatic scaling.

When should I use em instead of rem?

Use em for properties that should scale relative to the component's own font size: padding, margin, line-height, border-radius on buttons. This way, if you change a component's font size, all its spacing scales proportionally. Use rem for font sizes themselves to avoid compounding issues in nested components.

What are common px to rem conversions?

With 16px root: 12px=0.75rem, 14px=0.875rem, 16px=1rem, 18px=1.125rem, 20px=1.25rem, 24px=1.5rem, 32px=2rem, 48px=3rem, 64px=4rem. These correspond to common font sizes in design systems like Tailwind CSS.