🧮 Rem to Px Converter

Convert rem values from a spec or design file back to pixels using the current root font size for fixed-size contexts.

📐 工作原理与说明
px = rem × 根字号 root(rem 值乘以当前根元素 font-size)。校验:rem 与 root 均须填写且为有限数值,root 必须大于 0;缺省、0、负值或非数字都停止计算并清空旧结果,不回落 16px。判据:结果保留两位小数,同步显示「1rem = root px」基准说明,root 改变时换算同比例缩放。
把以 rem 为单位的标注或设计稿按当前根字号反算为像素,用于需要固定尺寸的场景或与设计师核对标注。

Formula & Standard References

Item Formula / Note Source / Standard
Reverse conversion px = rem x root font size, 16 px by default CSS Values and Units Level 4
Query units em and rem in media queries resolve against the initial size CSS Media Queries Level 4
Rounding error keep two decimals to avoid accumulated rounding drift CSS Values and Units Level 4
⚠️ 使用说明与注意事项

📏 常用尺寸速查表(root = 16px)

rempx常见用途
0.58小间距 / 描边
0.7512辅助文字
0.87514正文小字
116正文基准
1.2520小标题
1.524标题 / 间距
232区块标题
348大标题
464页面主标题

若采用 62.5% 根字号方案(1rem=10px),上表 px 值 = rem × 10,例如 1.6rem→16px、2.4rem→24px。