DevToolBox免费
博客

CSS 单位转换器 — px/rem/em/vw/vh/pt/%

在 px、rem、em、vw、vh、pt 和百分比之间转换 CSS 单位,支持自定义根字体大小。

Settings

Converted Values

UnitValueCopy
rem1rem
em1em
vw0.8333vw
vh1.4815vh
pt12pt
%100%

Click any row to use that value as the new input.

Common Presets

pxremempt
8px0.5rem0.5em6pt
10px0.625rem0.625em7.5pt
12px0.75rem0.75em9pt
14px0.875rem0.875em10.5pt
16px1rem1em12pt
18px1.125rem1.125em13.5pt
20px1.25rem1.25em15pt
24px1.5rem1.5em18pt
32px2rem2em24pt
48px3rem3em36pt
𝕏 Twitterin LinkedIn

评价此工具

4.2 / 5 · 232 人评价

保持更新

获取每周开发技巧和新工具通知。

无垃圾邮件,随时退订。

Enjoy these free tools?

Buy Me a Coffee

How to Use

  1. Enter a value and select the source unit
  2. Set root font-size (default 16px)
  3. Set viewport dimensions if using vw/vh
  4. See all conversions instantly
  5. Copy any converted value

Use Cases

  • Converting px designs to rem
  • Responsive design calculations
  • Understanding relative units
  • Design system unit standardization

FAQ

Why does root font-size matter for rem?
1rem equals the root font-size (usually 16px). Changing it affects all rem conversions.
What viewport size is used for vw/vh?
Default is 1920x1080. You can change it to match your target viewport.