DD
DevDash

CSS Unit Converter

Code Converters

Convert px to rem, em, vw, vh, pt — with custom base font size

By DevToolHQ teamUpdated 2026-04-15100% client-sideMethodology
100% client-side processing
px
px
px
px16
rem1
em1
vw1.1111
vh1.7778
pt12
%100
pxremvw (1440px)pt
40.250.27783
80.50.55566
100.6250.69447.5
120.750.83339
140.8750.972210.5
1611.111112
181.1251.2513.5
201.251.388915
241.51.666718
281.751.944421
3222.222224
402.52.777830
4833.333336
563.53.888942
6444.444448
8055.555660
9666.666772

Quick tip: 1rem = 16px · 1vw = 14.4px · 1pt = 1.3333px

About CSS Unit Converter

Converts CSS values between px, rem, em, vw, vh, pt, and percent. Enter a value in any unit and see all equivalent values simultaneously. Configurable base font size (default 16px), viewport dimensions (default 1440×900), and parent element size let you match your actual project context. The rem vs em distinction is a frequent source of confusion. rem (root em) is always relative to the html element's font size — typically 16px by default, but often set to 10px in projects that want 1rem = 10px for easy mental math. em is relative to the nearest ancestor element's font size, which means the same em value produces different pixel results in different contexts. rem is generally preferred for component sizing because it is predictable regardless of nesting depth. Use em when you want a component's internal spacing to scale with the component's own font size. The viewport units (vw, vh) are relative to the browser window dimensions. 1vw = 1% of viewport width, 1vh = 1% of viewport height. These are commonly used for responsive typography with clamp(), full-bleed hero sections, and sticky element sizing. The quick-reference table shows the rem equivalents for common pixel values (8, 12, 14, 16, 20, 24, 32, 48, 64) at the configured base size — useful to keep open alongside your editor.

How to Use CSS Unit Converter Online

  1. Paste your data into the input field above
  2. The result appears instantly in the output area
  3. Click "Copy" to copy the result to your clipboard

Convert px to rem, em, vw, vh, pt — with custom base font size. Runs 100% client-side — no data is sent to any server.

Sponsored

Recommended Tools

Frequently Asked Questions

Related Tools

Want API access + no ads? Pro coming soon.