Convert px, rem, em, percent, vw, and vh
CSS Tools
CSS Unit Converter
Convert CSS units in your browser. Translate px, rem, em, percent, vw, and vh with custom root, container, and viewport sizes.
- Runs in your browser
- No account required
- Copy-ready output
Set root font size, container width, and viewport size
Copy a full conversion table
Runs without uploading layout values
Notes
How this tool handles your input
This CSS unit converter helps translate one value into the units you need for layout work. Set the root font size, container width, and viewport size to match the page you are debugging.
How to use
- Enter a numeric CSS value.
- Choose the unit you are starting from.
- Adjust root, container, and viewport settings if needed.
- Click Convert CSS Units and copy the values you need.
Good for
- Convert design specs from px to rem
- Check viewport-based layout values
- Translate percentage widths into pixels
Examples
Input
24px with a 16px root
Output
1.5rem
Input
50vw with a 1440px viewport
Output
720px
FAQ
Is rem based on the root font size?
Yes. The rem conversion uses the root px value you enter.
What does percent convert against?
Percent uses the container px value because percentage sizing depends on context.
Does this know my actual CSS layout?
No. Enter the root, container, and viewport values from the layout you are checking.
Is my data uploaded to a server?
No. The tool runs in your browser, so the text you paste stays on your device.