CSS Unit Converter - px, rem, vw Conversion
Convert between px, rem, em, percent, vw, vh and pt with configurable root font size and viewport, plus a Tailwind class to CSS value reference.
Unit Converter
Tailwind Reference
Spacing & Sizing
p-0p-0.5p-1p-1.5p-2p-2.5p-3p-3.5p-4p-5p-6p-7p-8p-9p-10p-11p-12p-14p-16p-20p-24Font Size
text-xstext-smtext-basetext-lgtext-xltext-2xltext-3xltext-4xlBorder Radius
rounded-smroundedrounded-mdrounded-lgrounded-xlrounded-2xlrounded-3xlrounded-fullConversion runs locally in your browser. The Tailwind reference uses the default configuration.
About This Tool
The CSS Unit Converter solves a common source of mistakes: designs arrive in px, projects use rem, and responsive layouts need vw. Enter one value and every other unit is calculated at once.
It also includes a Tailwind reference for spacing, font size and radius, making it easy to switch between utility classes and plain CSS. All conversion happens locally.
Key Features
Seven units at once
Convert px, rem, em, percent, vw, vh and pt with results updating live.
Configurable baselines
Set the root font size, parent font size and viewport dimensions for your project.
Tailwind reference
Common spacing, font-size and radius classes with search by class or value.
One-click copy
Copy any converted value or reference row to avoid manual typing errors.
Local computation
No requests and no uploads of design or project data.
When to Use It
Design to rem
Convert design px values into rem to build a consistent responsive type and spacing scale.
Responsive sizing
Check the vw value of a width for a given viewport to prevent layout jumps across screens.
Tailwind audits
Find the actual pixel value behind classes like p-4 or text-sm when debugging overrides.
How to Use It
- 1Enter a value and choose its unit.
- 2Set the root font size, parent font size and viewport as needed.
- 3Review the converted values and copy the one you need.
- 4Search the Tailwind reference for the matching class.
Frequently Asked Questions
What is the difference between rem and em?
rem is always relative to the root font size, while em is relative to the parent element's font size and compounds when nested.
What is the percent based on?
This tool uses the parent font size, which suits typography. Width percentages need the parent container width instead.
Which Tailwind version does the reference use?
Common default values. If your project customized the theme, trust your own configuration.
Is my data uploaded?
No, conversion runs locally in your browser.
