Color Palette Generator
Generate beautiful color palettes from base colors or images. Supports 6 harmony types, image color extraction, and multiple export formats
A free browser-based CSS unit converter for px, rem, em, pt, %, vw, vh, and ch, with configurable font-size and viewport context so every conversion is accurate.
The CSS Unit Converter is a free, browser-based tool that converts a value between every common CSS length unit at once — px, rem, em, pt, %, vw, vh, and ch. Because several of those units are relative, you set the context first (root font-size, element font-size, and viewport size), then type a value in any unit and instantly see its equivalent in all the others.
Absolute units like px and pt always mean the same thing, but relative units resolve differently depending on where they sit in your document. This converter makes that dependency explicit instead of guessing, so the numbers it gives you match what the browser will actually render.
CSS length units fall into two groups. Absolute units — mainly px and pt — map to a fixed physical size regardless of context. Relative units — rem, em, %, vw, vh, and ch — resolve against something else, such as a font-size or the viewport, which is what makes responsive, accessible layouts possible.
A rem is relative to the root <html> font-size (16px by default), an em is relative to the current element's font-size, % resolves against a reference value, vw and vh are each 1% of the viewport width and height, and ch is the advance width of the "0" character in the current font. This tool converts everything through pixels as a common base, so it can move cleanly in either direction.
rem) — leave it at 16px unless your stylesheet changes the <html> size.em, %, and ch) to match the element you are styling.vw and vh resolve against the screen you care about.rem lets text scale with the user's browser font-size setting.vw/vh makes elements respond to the screen instead of staying frozen.Use px for things that should never scale, like hairline borders and precise icon sizing. Use rem for most typography and spacing so the whole interface scales consistently from a single root value. Reach for em when you want a value to track the component's own font-size — padding on a button that should grow with its label, for example. If you are testing how a typeface behaves at different sizes, pairing this converter with the Google Fonts Preview Tool makes it easy to see the rendered result behind the numbers.
The ch unit equals the advance width of the "0" glyph, which varies from font to font; this tool approximates it as half the element font-size, a close estimate for most text but not an exact match for every typeface. Viewport units are exact once you enter a viewport size, and they are the backbone of full-bleed sections and fluid type. When you move on from sizing to building the actual layout, the CSS Grid Generator pairs naturally with these units, and effects like the CSS Box Shadow Generator let you express blur and offset in whichever unit you prefer.
This converter is deliberately focused on CSS and typography units; if you need everyday physical measurements such as length, weight, or temperature, the general Unit Converter handles those instead. And once your sizes are settled, color work often comes next — the Hex to RGB Converter turns your palette into the exact values your stylesheet needs.
Divide the pixel value by the root font-size. At the default 16px root, 24px equals 1.5rem. This tool does it automatically the moment you enter a value, and updates every result if you change the root font-size.
A rem is always relative to the root <html> font-size, so it stays consistent everywhere, while an em is relative to the current element's font-size and can compound when nested. Use rem for predictable scaling and em when you want values to track a component's own text size.
1vw is 1% of the viewport width and 1vh is 1% of the viewport height. Enter your target viewport size in the context fields and the converter resolves those percentages into pixels and back for you.
Not exactly. The ch unit is the width of the "0" character in the active font, which differs between typefaces. This tool approximates it as half the element font-size, which is close for most fonts but should be treated as an estimate.
Yes. It is completely free and runs entirely in your browser. Nothing you type is uploaded or stored on a server.