Convert CSS units
Convert CSS units between px, rem, em, %, vh and vw with your own root font size and viewport. Click any result to copy. Free, in your browser.
- Files never leave your device
- Free, no sign-up
- No watermark
About CSS Unit Converter
Convert a value between every common CSS unit at once. Enter a number, pick its unit and instantly see it in px, rem, em, percent, vh and vw. Set your root font size, parent font size and viewport dimensions so the results match your project, and click any result to copy it. It is the quickest way to turn a design file’s pixel values into scalable rem units.
How to use CSS Unit Converter
- 1
Enter a value and choose its unit.
- 2
Adjust root font, parent font and viewport size if needed.
- 3
Read all conversions.
- 4
Click a result to copy it.
Why use this tool
- px, rem, em, %, vh and vw.
- Custom root and parent font size.
- Custom viewport width and height.
- Click to copy any result.
- Quick reference values.
Frequently asked questions
1rem equals the root font size, which is 16px in most browsers by default.
rem is relative to the root and predictable. em is relative to the parent and compounds when nested.
rem respects the user’s browser font size, which improves accessibility.
They are percentages of the viewport height and width. 50vw is half the screen width.
No. Everything is processed in your browser tab. Nothing you type or paste is sent to CodeMites or any other server.
Yes. There is no account, no watermark and no usage limit. The tool runs in your own browser, so there is no server cost to charge you for.
Yes. It runs in any modern browser on Android and iOS as well as on Windows, macOS and Linux, with nothing to install.
Yes. The CSS Unit Converter gives you plain CSS, so it works in stylesheets, CSS modules, styled-components or inline styles in any framework.
Yes. Anything you create with this tool is yours to use in personal and commercial work, with no attribution required.
Related tools
All CSS & Design tools →- CSS to Tailwind ConverterPaste CSS properties and get the equivalent Tailwind CSS utility classes instantly, ready to copy into your markup.
- Aspect Ratio CalculatorCalculate aspect ratios, keep proportions when resizing and copy the CSS.
- Color ConverterConvert colours between HEX, RGB and HSL in real time.
- CSS Gradient GeneratorCreate linear and radial CSS gradients visually: pick colours, add stops, set the angle and copy the code.
- Box Shadow GeneratorDesign CSS box shadows visually with offsets, blur, spread, colour and multiple layers, then copy the code.
- Text Shadow GeneratorCreate CSS text-shadow effects such as glow, outline and 3D with up to five layers and presets.