CSS Unit Converter
Convert any CSS value between px, rem, em, vw, vh, pt, and percentage — essential for responsive design work.
What Does This Tool Do?
CSS has many units for sizes — px (pixels), rem (relative to root font size), em (relative to parent font size), vw (percentage of viewport width), vh (percentage of viewport height), pt (printer points), and % (percentage of parent). This tool converts between all of them based on your specified base font size and viewport dimensions.
Key Features
How to Use This Tool
- Enter the value to convert.
- Select the source unit.
- Set your base font size (typically 16px) and viewport width.
- Click Convert to see all equivalent values.
How It Works
All units are first converted to pixels using the base font and viewport values as reference points. Then the pixel value is converted to each target unit by applying the inverse of each unit's conversion factor.
Common Use Cases
Frequently Asked Questions
What should I set as the base font size?
Most browsers default to 16px as the root font size. If your CSS sets a different base size (e.g., html { font-size: 18px; }), enter that value for accurate rem conversions.
When should I use rem vs px?
rem units scale with user browser settings, making them better for accessibility. px values are fixed. Most modern best practices recommend rem for font sizes and spacing.
Related Tools
Link to This Tool
Copy and paste the code below to link to this tool from your website: