Smart CSS Unit Converter
Convert PX, REM, EM, %, VW, and VH instantly. Generate responsive typography scales and production-ready CSS.
How to use
Enter a value and pick a unit
Type any number in the Value field and select its unit — PX, REM, EM, %, VW, or VH. All other units update instantly in the results grid below.
Adjust context settings if needed
Click Context Settings to change the root font size (default 16px), parent/context size for EM and % calculations, and viewport dimensions for VW/VH.
Generate a typography scale
Set a base size and choose a modular scale ratio. The scale table generates 8 harmonically related sizes — from xs to H1 — with PX, REM, and EM values.
Copy CSS-ready output
Use the Responsive Font Generator for a clamp() value, or the CSS Export panel to copy Standard CSS, CSS Variables, SCSS, or Responsive CSS with one click.
Check the reference table
The Common Values table shows 15 frequently used sizes with PX, REM, EM, and Tailwind class. The active row highlights the value closest to your current input.
When developers use this tool
Translating Figma designs
Designers work in PX. Developers write in REM. The Figma → CSS helper converts any Figma pixel value to REM and the matching Tailwind class in one step.
Building fluid layouts
The clamp() generator creates viewport-fluid font sizes that scale smoothly between any two sizes without a single media query breakpoint.
Setting a type system
The scale generator creates a harmonically consistent type ramp — from caption to display — that you can drop straight into a design system or Tailwind config.
Working with Tailwind CSS
Tailwind's text-* classes are REM-based. The Tailwind mapping table shows exactly which class maps to which PX value at any root font size.
Accessibility & scaling
REM units respect browser font-size preferences. Use this tool to convert PX designs to REM to keep layouts accessible for users who need larger text.
Exporting to design tokens
Copy CSS Variables or SCSS variables for your entire type scale and paste them straight into your design token file or theme configuration.
How it works
Pixel-first math
Every input is first converted to a pixel value using the current context (root size, parent size, viewport). All other unit outputs are derived from that canonical PX value — so conversions are always consistent.
Configurable context
Root font size (default 16px), parent element font size, and viewport dimensions are all configurable. Change any one and all conversion results, scale values, and Tailwind mappings update in real time.
Modular type scale
The scale generator multiplies a base size by a fixed ratio at each step — the same algorithm used by Modular Scale and Type Scale.app. Eight steps give you xs through H1, all mathematically harmonious.
Fluid clamp() formula
The responsive generator builds a CSS clamp() expression from min/max values and a VW percentage. The output is immediately copy-ready and previews live in the browser so you can see the rendering before pasting.
Related tools
Frequently asked questions
Quick answers about this free online tool.
