Convert CSS units
Convert values between CSS units (px, rem, em, %) with customizable base font sizes. Main function - unit conversion table, additional - CSS code conversion with nesting support.
Commonly used values, automatically converted based on base font size
| px | rem | em | % |
|---|---|---|---|
4px | 0.2500rem | 0.2500em | 25.0000% |
6px | 0.3750rem | 0.3750em | 37.5000% |
8px | 0.5000rem | 0.5000em | 50.0000% |
10px | 0.6250rem | 0.6250em | 62.5000% |
12px | 0.7500rem | 0.7500em | 75.0000% |
14px | 0.8750rem | 0.8750em | 87.5000% |
16px | 1.0000rem | 1.0000em | 100.0000% |
18px | 1.1250rem | 1.1250em | 112.5000% |
20px | 1.2500rem | 1.2500em | 125.0000% |
24px | 1.5000rem | 1.5000em | 150.0000% |
28px | 1.7500rem | 1.7500em | 175.0000% |
32px | 2.0000rem | 2.0000em | 200.0000% |
36px | 2.2500rem | 2.2500em | 225.0000% |
40px | 2.5000rem | 2.5000em | 250.0000% |
48px | 3.0000rem | 3.0000em | 300.0000% |
56px | 3.5000rem | 3.5000em | 350.0000% |
64px | 4.0000rem | 4.0000em | 400.0000% |
72px | 4.5000rem | 4.5000em | 450.0000% |
80px | 5.0000rem | 5.0000em | 500.0000% |
96px | 6.0000rem | 6.0000em | 600.0000% |
In modern web development, adaptability and accessibility of interfaces play a crucial role. Our CSS Unit Converter is a powerful tool for frontend developers and web designers that automates font size and spacing calculations. Forget about calculators and manual formulas: convert px to rem, em, or percentages instantly.
The tool works in two modes, covering all layout needs: from converting a single value to processing entire code fragments.
All relative units (rem, em, %) depend on the base font size. By default in browsers this is 16px, but design systems often use 14px, 18px, or 20px. Our tool allows you to set any base size and saves it in tab settings. You can create separate tabs for different projects and switch between them without losing context.
Simply enter a value in any field (e.g., in pixels), and the calculator will automatically recalculate it to other units:
A unique feature of our service is the CSS Code Converter mode. Paste your CSS code, select the conversion direction (e.g., from px to rem), and the algorithm will process the entire code. The tool accounts for selector nesting and parent font-size properties to correctly calculate complex em values.
Understanding the difference between units is critically important for quality layout.
Using rem allows users to scale the interface through browser settings (e.g., for visually impaired users). If a site is hardcoded in px, changing the font size in the browser won't affect the layout, which degrades accessibility (a11y).
The em unit is useful for creating components where spacing (padding, margin) should depend on the element's own font size. However, you need to be careful with em due to the compounding effect. Our converter helps track these dependencies.
Encode and decode Base64
Decode JWT tokens
Generate hashes (MD5, SHA-1, SHA-256)
Test regular expressions
Generate UUID v4
Encode and decode URL
Encode and decode HTML entities
Convert between CSV, JSON and XML formats
Format and validate JSON, XML, CSV