CSS Units Converter — px, rem, em, vw, vh, pt
Convert between CSS units: px, rem, em, vw, vh, %, and pt. Bidirectional with configurable base font size and viewport dimensions.
CSS Units Converter — px, rem, em, vw, vh, pt
Configuration
Converted: 16 px, 1 rem
Pixels
Root EM
Parent EM
Viewport Width %
Viewport Height %
Percentage
Points (print)
Quick reference: common px values
| px | rem | em | vw | vh | % | pt |
|---|---|---|---|---|---|---|
| 4 | 0.25 | 0.25 | 0.277778 | 0.444444 | 25 | 3 |
| 8 | 0.5 | 0.5 | 0.555556 | 0.888889 | 50 | 6 |
| 12 | 0.75 | 0.75 | 0.833333 | 1.333333 | 75 | 9 |
| 14 | 0.875 | 0.875 | 0.972222 | 1.555556 | 87.5 | 10.5 |
| 16 | 1 | 1 | 1.111111 | 1.777778 | 100 | 12 |
| 18 | 1.125 | 1.125 | 1.25 | 2 | 112.5 | 13.5 |
| 20 | 1.25 | 1.25 | 1.388889 | 2.222222 | 125 | 15 |
| 24 | 1.5 | 1.5 | 1.666667 | 2.666667 | 150 | 18 |
| 32 | 2 | 2 | 2.222222 | 3.555556 | 200 | 24 |
| 40 | 2.5 | 2.5 | 2.777778 | 4.444444 | 250 | 30 |
| 48 | 3 | 3 | 3.333333 | 5.333333 | 300 | 36 |
| 64 | 4 | 4 | 4.444444 | 7.111111 | 400 | 48 |
| 80 | 5 | 5 | 5.555556 | 8.888889 | 500 | 60 |
| 96 | 6 | 6 | 6.666667 | 10.6667 | 600 | 72 |
| 128 | 8 | 8 | 8.888889 | 14.2222 | 800 | 96 |
Updated . Provided as is. Check the output before you rely on it in production.
How to use CSS Units Converter — px, rem, em, vw, vh, pt
- 1
Enter a value and select your source unit
Type any number into the Value field and choose your starting unit (px, rem, em, vw, vh, %, or pt). All other units update instantly as you type.
- 2
Configure root and parent font-size
Set the root font-size (default 16px) to get accurate rem conversions. Set the parent font-size for em and % calculations — useful when you know the inherited font-size in your component tree.
- 3
Set viewport dimensions for vw/vh
Enter the target viewport width and height for accurate vw and vh conversions. Default is 1440×900 (typical desktop). Change to 375×812 for iPhone layout work.
- 4
Copy any converted value
Use the Copy control on any unit card to copy the numeric value to your clipboard — ready to paste directly into your CSS.
- 5
Use the quick reference table
Scroll down to see a reference table of common px values (4px–128px) converted to all units. Helpful for building consistent spacing scales.
Questions and answers
What is CSS Units Converter?
How do I convert px to rem?
Does CSS Units Converter store or send my data?
What is the difference between rem and em?
Use it as an API
CSS Units Converter — px, rem, em, vw, vh, pt is also callable as a free HTTP JSON API at
https://aidevhub.io/api/css-units-converter/ — GET with query
parameters or POST with a JSON body, no authentication, CORS enabled, fair use
(abusive traffic is throttled at the edge; there is no per-request quota header). Responses return
{ ok, tool, result, meta }.
curl -s "https://aidevhub.io/api/css-units-converter/?value=24&unit=px"
Machine-readable contract: /api/tool/css-units-converter.json All API endpoints: /agents/ LLM site index: /llms.txt
For AI agents: how to call this tool
Machine-readable contract, endpoints and examples. Humans can ignore this section.
Best Path For Builders
Dedicated API endpoint
Deterministic outputs, machine-safe contracts, and production-ready examples.
Dedicated API
https://aidevhub.io/api/css-units-converter/ OpenAPI: https://aidevhub.io/api/openapi.yaml