Browse every CSS unit — absolute (px, cm, pt), font-relative (em, rem, ch), viewport (vw, dvh), container-query, grid (fr), angle, time and resolution — in a searchable, type-filterable reference with a description, a "when to use" note and copy-ready tokens. In your browser, free.

Every CSS unit, explained. Everything runs in your browser from a built-in reference — nothing is sent to the server.

No unit matches your search.
Try a different unit or category — for example rem, dvh, fr or angle.

About CSS Units Reference

The CSS Units Reference documents every unit the language offers — 45 in all — organized by type: absolute units like px, cm and pt; font-relative units like em, rem, ch and lh; viewport units from vw and vh through the newer svh, lvh and dvh; container-query units like cqw and cqi; the grid fr unit; plus angle, time, resolution and percentage.

Each card gives you more than a definition: the unit token in copyable monospace, its full name, its category, a plain-language description of how it is computed, and a practical “when to use” note that says where the unit earns its place — and where a different one serves better.

Search matches tokens, names and meanings, so rem, viewport width and root all find their units, and type chips filter the grid down to one family. Everything runs in your browser from a built-in reference, with nothing sent to a server.

How to use CSS Units Reference

  1. Search for a unit by token, name or meaning — for example rem, viewport width or angle.
  2. Use the type chips to filter the grid to absolute, font-relative, viewport, container, grid, angle, time, resolution or percentage units.
  3. Read each unit’s description and its “when to use” note to pick the right one.
  4. Click the copy button to grab the unit token for your stylesheet.

Frequently asked questions

Use rem for font sizes and anything that should scale with the user’s preferred text size — rem tracks the root font size, so browser accessibility settings work. Use px for things that must stay optically constant, like hairline borders.

em is relative to the current element’s own font size, so nested elements compound the value; rem is always relative to the root element, giving predictable results. That is why rem has become the default choice for spacing and type scales.

Mobile browsers show and hide their toolbars, changing the visible height, while vh stays fixed to the larger layout size. The dynamic unit dvh tracks the actual visible height as toolbars move, and svh/lvh pin to the smallest and largest states.

fr distributes a grid container’s free space by fraction: grid-template-columns: 2fr 1fr gives the first column twice the leftover width of the second, after fixed tracks and gaps are subtracted. It only exists inside grid track definitions.

They size elements relative to their nearest query container rather than the viewport: cqw is 1% of the container’s width, cqi 1% of its inline size. They let a component scale to the box it lives in, independent of screen size.

Yes. All 45 units are documented for free in a page that runs entirely in your browser — no sign-up, no requests to the server.

Need help?
Found an issue with this tool? Let our team know.
Report an issue

Add this free tool to your own website — copy and paste the code below.