Category: Developer tools
CSS Unit Converter
Convert px, rem, em, %, vw and vh
Enter a value in px, rem, em, %, vw or vh with its base font size, viewport and container, and read the same length in every other unit. Runs in your browser on LocalTools.
Conversion happens in the page from the numbers you type. Nothing is sent anywhere.
Everything on this page is processed in your browser. Nothing is uploaded.
What this tool does
Enter a value in px, rem, em, percent, vw or vh, plus the base font size, viewport and container it is relative to, and get the same length in every other unit. A pixel value converts to rem the same way everywhere, but percent, vw and vh do not: they depend on a container size or a viewport that changes from page to page. This tool asks for that context up front, so the numbers it gives back are the ones that would actually render, not a generic 16px-root guess. rem and em are treated the same way here, both scaled from the base font size you give, since without a real parent element on the page there is no separate parent size to tell them apart by. Change the base font size to see how a visitor's enlarged text setting shifts every rem and em value at once.
How to use it
- Enter the value and pick the unit you are converting from.
- Set the base font size, viewport width and height, and container size it applies to.
- Read the same length converted into every other unit.
Privacy
This tool runs entirely in your browser. Your input is never uploaded, stored or shared — closing the tab removes it.
Frequently asked questions
- How do I use the CSS Unit Converter?
- Type the value and choose the unit it is currently in — px, rem, em, percent, vw or vh — then set the base font size, viewport width and height, and container size it is relative to. The same length is shown converted into every other unit. No sign-in is needed.
- Which inputs and options does it support?
- Six units are covered: px, rem, em, percent, vw and vh. Alongside the value and its source unit you can set the base font size, the viewport width and height, and the container size that percentages are measured against, because those settings decide the result.
- How do I view or copy the result?
- Results appear on the page: the same length is listed in every other unit at once, so you read the one you need and copy it straight into your stylesheet. There is no separate export or download step.
- Is my input, file, or result uploaded?
- No. Inputs, files, settings and results stay in the browser and are not uploaded to LocalTools. The conversion happens on your device, with no server-side processing, no account and no cloud history.
- What does this tool not support?
- It handles px, rem, em, percent, vw and vh only, so units such as pt or cm are out of scope. It converts one value at a time, with no batch mode, file handling or export. It also scales rem and em from the same base font size you enter rather than tracking a separate parent font size.