CSS Unit Converter

Converts a length between px, rem, em, pt, vw, vh, and percent all at once. Fast, free, and built for simple browser-based workflows.

Instant
Processing
Private
Browser First
Free
No Signup

CSS Unit Converter

Browser default is 16px.
Used for em and %.
Converted Values

Results update as you type. Click any value to copy it.

UnitValueNotes
Advertisement

728 x 90 In-Content Ad

About This Tool

CSS Unit Converter is a free online tool that converts a length between px, rem, em, pt, vw, vh, and percent at once. Enter a value and its unit, and every equivalent appears in a table you can click to copy -- no manual math or lookup table needed.

It is useful when a design file gives you a pixel measurement but your codebase is built on rem for accessibility, when you are translating a fixed layout into viewport units for responsive design, or when you need to know what percentage a font-size actually resolves to against its parent element. Setting a custom root and parent font size also matches results to a project that does not use the 16px browser default.

Everything runs inside your browser using formulas you can check line by line, so no measurement is sent to a server. Results update as you type, which makes it fast to try several root font sizes or viewport widths side by side without reloading anything.

Converts a single value into px, rem, em, pt, vw, vh, and % simultaneously
Custom root font size for accurate rem conversions on non-default projects
Custom parent font size for accurate em and % conversions
Custom viewport width and height for accurate vw and vh conversions
Results update live as you type, with no button to click
Click any converted value in the table to copy it instantly

How to Use CSS Unit Converter

1

Enter a value and unit

Type a number into Value and choose its Unit, e.g. 16 and px.

2

Set your context

Adjust Root Font Size, Parent Font Size, Viewport Width, and Viewport Height if your project does not use the 16px / 1920x1080 defaults.

3

Read the table

All seven units update instantly as you type or change any setting.

4

Copy a value

Click any result in the table to copy it, complete with its unit. Reset restores the defaults.

Frequently Asked Questions

Is this tool completely free?

Yes! All our tools are 100% free to use with no hidden costs, no registration required, and no credit card needed.

Is my data safe and private?

Absolutely. All tools run entirely in your browser (client-side). Your data never leaves your device and is not sent to our servers.

Can I use this tool offline?

Yes, once the page is loaded, the tool will continue to work even if you lose internet connection since it runs in your browser.

Is there a character limit?

There is no strict character limit, but very large amounts of text (100,000+ characters) may slow down your browser.

Can I use this for commercial projects?

Yes! All our tools are free for both personal and commercial use.

Why do I need to set a root font size?

rem units are always relative to the root (html) element's font size, which defaults to 16px in every browser but can be changed by a site's own CSS or a visitor's accessibility settings. Setting it here matches the conversion to your actual project instead of assuming the default.

What is the difference between em and rem?

em is relative to the font size of the element's own parent, so nested elements can compound; rem is always relative to the root element's font size, so it stays predictable no matter how deeply nested an element is. That is why the tool has separate root and parent font size fields.

How is pt converted to px?

Using the standard print-to-screen ratio of 96 pixels per inch and 72 points per inch, so 1pt equals 96/72, or about 1.333px. This is the same ratio browsers use internally.

Why do I need to enter a viewport width and height?

vw and vh are percentages of the browser window's width and height, so the same value produces a different pixel result on a 1920px-wide screen than on a 375px-wide phone. Entering your actual target viewport gives an accurate conversion for that screen.

Can I convert from any unit to any other unit?

Yes. Enter a value in any of the seven supported units and the table shows its equivalent in all of the others at once -- there is no need to pick a "from" and "to" unit separately.

Why does the percent row differ from the em row if they are both relative to the parent?

They use the same base but express it differently -- em shows a multiplier of the parent's font size (e.g. 1.5em), while % shows the same relationship as a percentage (e.g. 150%). The underlying pixel value is identical.