Convert CSS units instantly: px to rem, rem to em, px to vw/vh, pt, and percent. Set custom base font size and viewport dimensions for accurate results.
CSS Units Converter is a free, browser-based tool
from UseToolSuite's
Color & CSS Tools collection.
All processing happens locally on your device — your data is never uploaded to any server.
Use the tool below, then scroll down for detailed documentation, frequently asked questions, and related resources.
What is CSS Units Converter?
CSS Units Converter is a free online tool that converts any CSS length value between all common units: px,
rem, em, pt, pc, vw, vh, and percent. Enter a value in any unit and instantly see the equivalent in every
other unit. Configure the root font size, parent element size, and viewport dimensions to get accurate
context-aware conversions that match your project's CSS setup exactly.
When to use it?
Use CSS Units Converter when translating design specs from tools like Figma (which outputs px values)
into accessible rem values for your stylesheet, converting legacy px-based code to a rem-based design
system, or understanding what viewport-relative values like 2.5vw equal in pixels at a given screen size.
It is also useful when working with CSS-in-JS libraries where you need numeric values rather than CSS strings.
Common use cases
Front-end developers use CSS Units Converter to convert Figma-exported px values to rem for accessible
typography, verify that rem-based spacing values produce the correct pixel output, calculate vw equivalents
for fluid type sizing with clamp(), convert print stylesheets between pt and px, and validate that
percentage-based widths match expected pixel dimensions at specific viewport sizes.
What is the CSS Units Converter?
The CSS Units Converter is a straightforward utility designed to mathematically translate absolute pixel values (px) into scalable, responsive units like em, rem, vh, and vw. Modern web design requires building interfaces that scale perfectly across mobile phones, tablets, and massive desktop monitors. Using relative units like rem (root em) ensures that your typography and spacing scale according to the user's browser accessibility settings, rather than remaining fixed at a rigid pixel size.
How does it work?
The tool relies on simple client-side mathematical calculations based on a defined "base" value. By default, most browsers use a root font size of 16px. If you input 24px and set the base to 16px, the tool divides 24 by 16 to instantly output 1.5rem. It provides bidirectional conversions across multiple unit types simultaneously, updating all output fields in real-time as you type, without requiring any page reloads or server requests.
Common use cases
Frontend engineers use the CSS Units Converter when migrating a legacy, pixel-based website to a modern, fully responsive architecture based on rem units. Web designers use it when translating fixed-pixel values from a Figma or Sketch mockup into the fluid CSS required for the actual build. Accessibility specialists use it to ensure that all typography is built using scalable units, allowing visually impaired users to successfully zoom the interface.
Absolute vs relative — and why it matters for accessibility
The core split: absolute units (px) are fixed, while relative units (rem, em, %, vw) depend on something else. For font sizes this isn’t just preference — it’s accessibility. Users can change their browser’s default font size to cope with low vision, and px font sizes ignore that preference, while rem scales with it. WCAG 2.1 (1.4.4) requires text to resize to 200% without breaking, which rem-based sizing helps satisfy. The default base is 16px, so 1rem = 16px unless the root font-size is overridden.
Pick the unit by what you’re sizing
There’s no single “best” unit — match it to the job:
| Property | Reach for | Why |
|---|
| Font size | rem | Respects user zoom preference |
| Component padding tied to its text | em | Scales with the element’s own font size |
| Layout width/height | %, fr, px | Relative to parent or fixed |
| Full-viewport sections | dvh/svh | Mobile-chrome-safe (not bare vh) |
| Fluid type | clamp() w/ vw | Continuous scaling |
| Context-aware components | cqi/cqw | Relative to the container |
The em-compounding trap
em is relative to the parent’s font size, so it compounds when nested: a 1.2em element inside another 1.2em element renders at 1.44× the base. That’s powerful for components that should scale as a unit, but it’s a frequent source of “why is this text huge three levels deep?” bugs. When in doubt for font sizing, rem (always relative to the root) avoids the surprise; reserve em for padding/margins you want to track the element’s own text size.
The mobile vh fix
100vh on mobile is taller than the visible area because it includes the space behind the browser’s address bar, causing content to be cut off or jump as the bar hides. Use 100dvh (dynamic viewport height, adjusts as chrome appears/disappears) or 100svh (small viewport height, the conservative choice) instead. These are supported in current Chrome, Safari, and Firefox and fix the classic “full-height section is slightly too tall on mobile” problem.
How helpful was this tool?
Click to rate
Awesome! Glad it helped.
We don't have a marketing budget. The best way to support this free tool is by sharing it with other developers!
Help us improve!
Sorry it didn't meet your expectations. We're always looking to make these tools better. What was missing or broken?
Open GitHub Issue