CSS Unit Converter

Web Developer Tools

Convert between CSS units: px, em, rem, vw, and more

Configuration (base sizes)
UnitValueDescription
px16Pixels — absolute unit, 1/96 of an inch
em1Relative to parent element's font-size
rem1Relative to root element's font-size
%100Relative to parent element
vw1.11111111% of viewport width
vh1.77777781% of viewport height
pt12Points — 1/72 of an inch (print)
cm0.42333333Centimeters
mm4.2333333Millimeters
in0.16666667Inches
pc1Picas — 12 points

Common conversions

How to Use This Tool

1

Enter your input

Type or paste the value you want to look up or convert into the input field.

2

Get instant results

Results are computed immediately in your browser — no network request needed.

3

Use the reference

Browse the built-in reference table to find related values, codes, or descriptions.

4

Copy what you need

Use the "Copy" button to grab any value from the results for use in your project.

About This Tool

CSS Unit Converter is a free, instant, browser-based tool that convert between css units: px, em, rem, vw, and more. Web developer tools provide quick access to reference data and small utilities that come up constantly during development. HTTP status codes, Unix timestamps, chmod permission calculators, ASCII tables, and similar references are things every web developer looks up regularly. Having them in one place, instantly accessible in your browser, speeds up your workflow significantly.

This tool runs entirely in your browser with no server calls required. Results appear instantly and everything works offline once the page is loaded.

Bookmark this page for quick access during development sessions. Whether you're debugging a 403 vs 401 response, converting a timestamp from a database field, setting file permissions on a Linux server, or checking what ASCII character code 127 corresponds to, having a reliable, distraction-free reference tool cuts down the time you spend looking things up and lets you stay focused on the problem at hand.

CSS Unit Converter converts between px, rem, em, vh, vw, and other CSS units using a configurable base font size. This is essential for building accessible, responsive layouts where units must be consistent across different screen sizes and user font preferences.

Why Use This Tool?

CSS Unit Converter converts between px, rem, em, vh, vw, and other CSS units using a configurable base font size. This is essential for building accessible, responsive layouts where units must be consistent across different screen sizes and user font preferences.

Common pitfalls and gotchas

The mistakes that come up repeatedly when working with web developer tools tools — most of them invisible until they cause production failures or silent data corruption.

  • Treating reference data as immutable forever

    HTTP status codes, MIME types, and CSS units evolve. New status codes (425 Too Early, 451 Unavailable for Legal Reasons) get added; new MIME types appear for new file formats. Reference data baked into client code at build time can drift from current standards over years. Pin to a versioned reference and update on a regular cadence.

  • Confusing user-agent strings with reliable device detection

    User-agent strings are spoofable, parseable but not authoritative, and increasingly being frozen or randomized by browsers (Chrome's User-Agent Reduction). Don't make security decisions based on UA detection. For feature detection, use real feature checks (`if ('IntersectionObserver' in window)`) rather than UA strings.

  • Hardcoding timestamps in local time

    Timestamps stored as local-time strings without timezone information are unrecoverable when the codebase moves servers, when users span timezones, or when daylight-saving transitions create ambiguity. Always store timestamps as Unix epoch seconds (UTC) or ISO-8601 with explicit timezone offset.

Frequently asked questions

Are these references kept up to date?

Yes — we update reference data when standards change. HTTP status codes, MIME types, CSS units, and similar references reflect current specifications. If you spot something outdated, please email support and we'll fix it.

Can I rely on these tools for production decisions?

These tools are reliable references for routine work — looking up status codes, parsing user agents, converting timestamps. For high-stakes decisions (security configurations, compliance claims), cross-reference with the underlying RFCs and W3C specifications, which are the authoritative sources.

Will these tools work offline?

Once the page is loaded, most tools work offline — they run entirely in your browser. You can use them on a flight or in any environment without internet access after the initial page load. Refreshing the page may require connectivity.

Why is my browser showing different viewport dimensions than expected?

Browsers apply zoom level, system DPI scaling, and developer tool overlays that affect reported dimensions. The tool reports what the JavaScript runtime sees — which is what your CSS media queries also see. If a discrepancy exists, check zoom (Ctrl+0 to reset) and any open dev tool panels.

Related Tools