By Debmedia Technologies LLP · Kolkata, India · Updated
What Is It and When Do You Need It?
CSS sizes can be written in many units, and designers and developers need to move between them. Designs arrive in pixels, while good CSS uses rem so text respects user settings.
Enter a value, choose its unit and the base size.
How to Use This Tool
- Enter a value.
- Choose the unit it is in.
- Set the base font size if it is not 16.
- Press Convert.
How the Calculation Works
Everything is first changed to pixels: rem and em are multiplied by the base size, pt by 4/3, percent by base ÷ 100. Then pixels are divided back out for each unit. An em is treated as relative to the base size here.
Worked Example
24 px with a 16 px base is 1.5 rem, 1.5 em, 18 pt and 150%. 1 rem is 16 px.
Common Uses
- Turning a design into CSS.
- Accessible font sizing.
- Spacing scales.
- Print and screen sizes.
Tips and Common Mistakes
- Avoid setting html font-size in px; use a percentage.
- Use rem for text and em for component spacing.
- The table lists common sizes for quick reference.
Related Tools
Next, you may need the CSS clamp calculator, aspect ratio calculator, box shadow generator, border radius generator.
Everything runs in your browser. Nothing you type is uploaded, stored or sent to any outside service.
Frequently Asked Questions
Disclaimer: results are calculated in your browser from the numbers you enter. Check important results before you rely on them for money, health, safety or legal decisions.