Typography / CSS Unit Converter — CSS has many length units. Absolute units (px, pt, pc, in, cm, mm) are tied to physical measurements. Relative units (em, rem, %) are tied to font size or the root font size. The browser default font size is 16px; this converter assumes that base.
Conversions run locally in your browser. No values are sent anywhere.
Was Typography / CSS Unit Converter useful?
Typography / CSS Unit Converter是什么?
CSS has many length units. Absolute units (px, pt, pc, in, cm, mm) are tied to physical measurements. Relative units (em, rem, %) are tied to font size or the root font size. The browser default font size is 16px; this converter assumes that base.
Note: the em and rem conversions depend on the font-size context. If a CSS rule sets a different base font size, the em values change accordingly.
使用方法
-
Enter a value
Type the length in any supported unit. The default is 1 px.
-
Pick the units
The from/to dropdowns cover all the CSS length units: px, pt, pc, in, cm, mm, em, rem, %.
-
Mind the base
em assumes 16px base (browser default). rem also assumes 16px root. If your CSS uses a different base, multiply the em/rem result accordingly.
示例
12pt to px
12pt (a common body-text size) is exactly 16px in CSS.
12 pt
结果: = 16 px (at 96 DPI / 1px = 0.75pt)
常见问题
相关工具
Unit Converter
Convert length, weight, temperature, area, volume, speed, time, and data units instantly.
CSS Minifier
Shrink CSS by stripping comments, collapsing whitespace, and tightening punctuation. See byte savings live.
颜色选择器
从图片中挑选颜色,获取 HEX、RGB、HSL 和 CMYK 值。免费、在浏览器中运行,无需上传。
Aspect Ratio Calculator
Compute the aspect ratio of any width × height, and resize to a target width or fit inside a maximum box.
CSS Gradient Generator
Build linear and radial CSS gradients visually. Pick colors, drag stops, copy the CSS.
Last reviewed: 2026-09-25