PX Converter – Free PX to REM, EM, VW, PT, CM & DP Tool
⚡ Free CSS Tools · MockupTemplate.net

PX Converter — Convert Pixels to REM, EM, VW, PT, CM & DP

Type a pixel value and see all six CSS units instantly. Custom base font-size, viewport width, and DPI. Free, no sign-up, runs in your browser.

Live PX Converter
REM
EM
VW
PT
CM
DP
Enter a value in any unit below to see its PX equivalent:
Enter a value above to calculate PX.

Scroll for formulas, tables & best practices

Introduction

What Is a PX Converter and Why Do You Need One?

When you write CSS, pixel values feel natural — they map directly to what you see on screen. But modern web development demands more than pixels. Accessibility guidelines ask for scalable type in rem or em. Fluid layouts use vw. Print stylesheets speak in pt and cm. Android engineers work in dp. Translating between these units manually wastes time and introduces rounding errors.

This free PX converter calculates all six units simultaneously as you type, using the exact formulas used by CSS engines. Built for front-end developers, UI designers, and anyone who touches CSS — with no sign-up, no ads, and no data leaving your browser.

Background

What Is a Pixel (px) in CSS?

In CSS, a pixel (px) is not a physical screen pixel — it's a reference pixel equal to 1/96th of an inch at arm's length, as defined by the W3C. On a typical 96 DPI monitor, 1 CSS pixel = 1 physical pixel. On a high-DPI (Retina) display, 1 CSS pixel might equal 2 or 3 physical pixels, but your CSS values stay the same — the browser handles scaling automatically.

Pixels are an absolute unit. They don't scale with the user's browser font-size preference, making them a poor choice for typography but ideal for borders, shadows, and fine-grained spacing where you need precise, fixed control.

REM PX to REM Converter

REM (root em) is relative to the font-size of the root <html> element. The browser default is 16px, so 1rem = 16px. If a user increases their browser font size to 20px, everything set in rem scales proportionally — a major accessibility win.

rem = px ÷ baseFontSize

Example: 24px ÷ 16 = 1.5rem. In CSS: font-size: 1.5rem;

REM is the recommended unit for font sizes, heading sizes, and most spacing values. It respects user preferences and keeps your design system consistent across all screen sizes and accessibility settings.

EM PX to EM Converter

EM is relative to the font size of the element's parent. This makes it powerful for component-scoped sizing — padding, margin, and border-radius that scale with the component's text — but can lead to compounding if deeply nested.

em = px ÷ parentFontSize

This converter assumes parentFontSize = baseFontSize (the most common case). Example: 18px ÷ 16 = 1.125em.

Tip: Use em for padding and spacing inside a component so it scales with the component's own font size, and rem for the font size itself.

VW PX to VW Converter

VW (viewport width) equals 1% of the viewport's width. It's the backbone of fluid typography and fully-responsive layouts — a heading set in vw grows and shrinks smoothly as the browser window resizes.

vw = (px ÷ viewportWidth) × 100

Example: On a 1920px viewport, 192px = 10vw. On a 375px phone screen, that same 10vw = 37.5px.

Modern best practice pairs vw with CSS clamp(): font-size: clamp(1rem, 2.5vw, 2rem); — fluid between screens, clamped at the edges.

PT PX to PT Converter

PT (point) is a typographic unit: 1pt = 1/72 of an inch. It predates digital design and remains widely used in print, PDFs, desktop applications, and email CSS.

pt = px × 0.75

Example: 16px × 0.75 = 12pt — the classic body text size in print design.

Use points in @media print stylesheets, where centimetres and points are more predictable than screen-relative units like rem or vw.

CM PX to CM Converter

CM (centimetre) is a physical absolute unit. At 96 DPI, 1 inch = 96px and 1 inch = 2.54cm.

cm = px × 2.54 ÷ 96

Example: 96px × 2.54 ÷ 96 = 2.54cm (exactly 1 inch).

Centimetres are invaluable in @media print when you need a margin of exactly 2cm, or when designing a business card at exactly 8.5cm × 5.4cm.

DP PX to DP Converter

DP (density-independent pixel), also called DIP, is the standard unit in Android development and mobile design tools (Figma, Sketch). It ensures UI elements appear the same physical size on screens with different pixel densities.

dp = px × (160 ÷ dpi)

At the baseline of 160 DPI (medium-density Android), 1px = 1dp. On a 320 DPI device (xhdpi), 1dp = 2px.

Example at 160 DPI: 24px × (160 ÷ 160) = 24dp. At 320 DPI: 24px × (160 ÷ 320) = 12dp.

Reference

PX to REM, EM, PT, CM & VW Conversion Table

Common pixel values converted at the standard base of 16px and 1920px viewport. Bookmark this for quick reference during development.

PX REM (base 16) EM (base 16) PT CM VW (1920px)
8px0.5rem0.5em6pt0.2117cm0.4167vw
10px0.625rem0.625em7.5pt0.2646cm0.5208vw
12px0.75rem0.75em9pt0.3175cm0.625vw
14px0.875rem0.875em10.5pt0.3704cm0.7292vw
16px1rem1em12pt0.4233cm0.8333vw
18px1.125rem1.125em13.5pt0.4763cm0.9375vw
20px1.25rem1.25em15pt0.5292cm1.0417vw
24px1.5rem1.5em18pt0.635cm1.25vw
28px1.75rem1.75em21pt0.7408cm1.4583vw
32px2rem2em24pt0.8467cm1.6667vw
36px2.25rem2.25em27pt0.9525cm1.875vw
40px2.5rem2.5em30pt1.0583cm2.0833vw
48px3rem3em36pt1.27cm2.5vw
64px4rem4em48pt1.6933cm3.3333vw
80px5rem5em60pt2.1167cm4.1667vw
96px6rem6em72pt2.54cm5vw
128px8rem8em96pt3.3867cm6.6667vw
160px10rem10em120pt4.2333cm8.3333vw
256px16rem16em192pt6.7733cm13.3333vw
320px20rem20em240pt8.4667cm16.6667vw
Best Practices

PX vs REM vs EM vs VW — When to Use Which

Choosing the right CSS unit is a design decision. Here's a practical guide based on real-world front-end patterns:

✅ Use px for:

  • Border widths (border: 1px solid)
  • Box shadows and outlines
  • Small fixed icons and UI details
  • Media query breakpoints
  • Absolute positional offsets

✅ Use rem for:

  • Font sizes across the site
  • Global spacing scale (margin, padding, gap)
  • Component sizes that should scale
  • Accessible, user-preference-respecting layouts

✅ Use em for:

  • Padding inside buttons (scales with text)
  • Letter-spacing relative to font size
  • Component-internal spacing
  • Icon sizes placed next to text

✅ Use vw for:

  • Fluid display headings
  • Full-width hero sections
  • Clamped responsive typography
  • Containers with percentage-of-screen sizing
FAQ

Frequently Asked Questions

A PX to REM converter translates pixel values into REM (root em) units. REM is relative to the root <html> font size — usually 16px — making it ideal for scalable, accessible CSS typography and spacing. Instead of calculating 24 ÷ 16 = 1.5rem by hand every time, a converter does it instantly as you type.
The standard base font size is 16px (the browser default). So 16px = 1rem, 24px = 1.5rem, 32px = 2rem. Our converter lets you set a custom base — for example, some design systems set html { font-size: 10px; } so that 1rem = 10px, making mental math easier for the team.
Use REM for font sizes and spacing that should scale with the user's browser preferences. Use EM when a value should scale relative to its parent element's font size — great for component-scoped sizing like button padding. Use PX for precise, non-scalable values like borders, box shadows, and fixed icon sizes that should never change regardless of user settings.
To convert PX to VW: vw = (px ÷ viewport width) × 100. For example, on a 1920px viewport, 192px = 10vw. VW is ideal for fluid layouts and clamp() typography: font-size: clamp(1rem, 2.5vw, 2rem); scales smoothly between viewports with safe min/max bounds.
Yes, completely free. No account required, no sign-up, no rate limits. The converter runs entirely in your browser — no data is ever sent to any server. Bookmark it and use it as often as you like, on any device.
Scroll to Top