BunchTool — CSS Unit Converter
Quick Presets:
🔢 Source Dimension & Base Context
Stylesheet Context Parameters
Root Base Font Size (html): default 16px
Note: For 62.5% html base trick, set to 10px.
Parent Element Font Size (em / %):
📋 Conversion Scale & Live Typography
PX (Pixels) 32 px
REM (Root EM) 2 rem
EM (Parent EM) 2 em
% (Percentage) 200 %
VW (Viewport W) 1.67 vw
VH (Viewport H) 2.96 vh
PT (Points) 24 pt
PC (Picas) 2 pc
IN (Inches) 0.333 in
CM (Centimeters) 0.847 cm
MM (Millimeters) 8.47 mm
Rendered Font Size Preview
Typography Sample Text
Related Tools

More free Developer tools


💻 Developer Tools

CSS Unit Converter —
PX to REM, EM, VW, % & PT Calculator Online

Our free CSS Unit Converter provides a real-time calculator to convert dimension and font-size values across 11 standard CSS length units—including px, rem, em, %, vw, vh, pt, pc, in, cm, and mm. Built specifically for frontend web developers, UI designers, and responsive design systems, it allows you to customize the Root Base Font Size (e.g. default 16px or the 62.5% html base 10px trick), Parent Element Font Size, and Viewport Dimensions to ensure precise mathematical conversions. Test typography scales with the live rendered preview box and copy exact CSS unit strings with one click. Operating 100% client-side in secure local JavaScript, your dimensions and stylesheet parameters are never uploaded to external servers.

Bi-directional conversion across 11 CSS length and typography units (px, rem, em, %, vw, vh, pt, pc, cm, mm, in)
Customizable Root Base Font Size (html font-size) & Parent Element Font Size
Viewport Width (vw) & Viewport Height (vh) dimension ratio calculations
Interactive typography preview box rendering live font size changes
📐
11 UnitsCSS Lengths
Custom BaseRoot & Viewport
100% PrivateBrowser Computed
How It Works

Convert CSS Units in three steps

Step 1
🔢
Enter Value & Select Source Unit

Type your dimension value (e.g. 32) and pick the starting unit (px, rem, em, %, vw, vh, pt).

Step 2
⚙️
Configure Root & Viewport Base

Set your root font size (default 16px or 10px) and viewport width to match your project stylesheet.

Step 3
📋
Copy Converted CSS Units

Inspect the live conversion grid and click any unit card to copy formatted strings directly.

Why BunchTool

Why use our free CSS Unit Converter?

📐
Comprehensive 11-Unit Conversion

Convert accurately between absolute units (px, pt, pc, in, cm, mm), relative font units (rem, em, %), and viewport units (vw, vh).

⚙️
Custom Root & Parent Context

Customize html root base font size, parent font size, and viewport dimensions to mirror your exact CSS design system setup.

🔒
100% Private In-Browser Math

All conversions and rendering previews execute locally in your browser. No dimension inputs or stylesheet parameters are ever sent to any server.

FAQ

Frequently asked questions

What is the difference between rem and em in CSS?
The 'rem' (Root EM) unit is calculated relative to the root html element's font size (typically 16px by default). The 'em' unit is calculated relative to the immediate parent element's font size, which makes em units contextual to local typographic hierarchy.
How does Root Base Font Size affect REM calculations?
By default, browser root font size is 16px, so 1rem = 16px. If a project sets html { font-size: 62.5% }, the base becomes 10px, making 1rem = 10px (e.g. 1.6rem = 16px). You can adjust the Root Base Font Size in this tool to match your design system.
How do I convert pixels (px) to Viewport Width (vw)?
Viewport Width (vw) represents 1% of the total viewport screen width. To calculate px to vw: (px value / viewport width) * 100. For example, 19.2px on a 1920px screen equals 1vw.
Why use relative units (rem, em) instead of fixed pixels (px)?
Relative units ensure accessible responsive design. Using 'rem' respects user browser font size preferences and zoom accessibility settings, whereas fixed pixels ('px') force rigid dimensions.
Is my unit input or design data sent to external servers?
No. All unit conversions, viewport calculations, and rendering preview math execute 100% locally inside your web browser using JavaScript.
Detailed Guide

Understanding CSS Length Units, Typographic Base Ratios & Viewport Scaling

CSS length units are divided into absolute physical units (px, pt, in, cm, mm) anchored to 96 CSS pixels per inch, and relative typography units (rem, em, %) anchored to root or parent font sizes.

The rem (Root EM) unit evaluates against the root <html> element's font size (\( ext{rem} = ext{px} / ext{Root Base}\)). The em unit scales relative to the local parent element's computed font-size (\( ext{em} = ext{px} / ext{Parent Base}\)), enabling compounding typographic scaling.

Viewport percentage units (vw, vh) represent 1% of total screen viewport width or height (\( ext{vw} = ( ext{px} / ext{Viewport Width}) imes 100\)), driving fluid fluid typography and responsive layout containers.

Other Collections

Explore other useful categories

Explore 247 more free tools —
no login, no limits.

BunchTool covers PDF editing, text conversion, SEO analysis, calculators, design tools, unit converters and much more. All 100% free, all browser-based.

Browse All 247 tools →