JSON to Rust Struct
Generate serde-ready Rust structs from a sample JSON document.
Convert between px, rem, em, pt, %, vw and vh with the right context.
The CSS Units Converter converts between every length unit at once, exposing the root font size, parent font size and viewport dimensions as settings rather than assuming them — because the relative units depend on all four.
Convert a value between every CSS length unit at once. The absolute units have fixed relationships — CSS defines an inch as exactly 96px regardless of the real screen — so those are simple arithmetic.
The relative units are where a converter has to be honest. rem depends on the root font size, em on the parent element's, percentages on the containing block, and the viewport units on the window. All four are exposed as settings rather than assumed, so a project with a 62.5% root trick or a 14px base converts correctly. A conversion table for the common sizes is generated alongside, which is what you actually want when setting up a spacing scale.
Root size, parent size and viewport dimensions are settings, so a project with a 14px base or the 62.5% trick converts correctly.
px, rem, em, pt, pc, in, cm, mm, Q, %, vw, vh, vmin, vmax, ch and ex, all calculated together.
The common sizes converted in one table, which is what you want when setting up a scale rather than converting a single value.
CSS defines an inch as exactly 96px regardless of your screen, which is why 12pt is exactly 16px.
em is relative to the element’s own font size, so nested values multiply — which is how text quietly shrinks.
Every other unit is calculated at once.
Root font size, parent font size and viewport dimensions.
A conversion table for the common sizes, for setting up a scale.
Click any result to copy it.
rem for anything that should scale with a reader's font size preference — text, spacing, most sizing. px for things that genuinely must not scale, such as a one-pixel border.
rem is always relative to the root font size. em is relative to the element's own font size, so nested elements compound — three levels of 0.9em is 0.73, which is how text quietly shrinks.
Setting html { font-size: 62.5% } makes 1rem equal 10px, so conversions are mental arithmetic. It works, but it changes the meaning of rem for every library you include, so it is less popular than it was.
Exactly 1.333… CSS defines 1in as 96px and 1pt as 1/72in, so 12pt is exactly 16px. These are fixed ratios and have nothing to do with your physical screen.
What people who use the CSS Units Converter think of it. Reviews come from visitors and are posted as written.
No ratings yet
Yours would be the first.
0 reviews
Newest first
No reviews yet
Be the first to rate the CSS Units Converter. It takes half a minute and no account.
Write the first reviewGenerate serde-ready Rust structs from a sample JSON document.
Generate complete fake user profiles for seeding and design work.
Press any key and see event.key, event.code and the modifier state.
Turn a block of text into a comment in any language, wrapped and aligned.
Generate realistic test rows in JSON, CSV or SQL from fields you choose.
Run XPath expressions against your own XML and see every node that matches.
Turn any text into a safe slug, filename, anchor or branch name.
Encode and decode Base32, including the Crockford and hex variants.