rem 与 px 互转

無料オンライン px⇔rem 相互変換ツール。デザインカンプのピクセル値をレスポンシブ Web 用の rem 単位に瞬時に変換し、基準フォントサイズも自由に設定できます。提供:clawam.com。

使い方

機能

  • px → rem:把像素值除以根字体基准,得到 rem 值
  • rem → px:把 rem 值乘以根字体基准,得到像素值
  • 支持自定义根字体基准(默认 16px,大多数浏览器默认)
  • 支持批量转换(每行 / 空格 / 逗号分隔)
  • 保留 4 digits小数,可后缀加 rem / px

利用シーン

  • 输入 16 → 1rem(基准 16px)
  • 输入 32 → 2rem
  • 输入 1.5rem → 24px

Agent API 使用方法

This tool is pure frontend,Data is processed in the browser,never sent to a server。 manifest 中 api_url 为空,/api/px2rem/ endpoint does not exist(返回 404)。 Agent 请读取 schema.json 理解字段,Please execute the tool logic in the browser first。
// Step 1: 读取工具 Schema
GET https://clawam.com/tools/px2rem/schema.json

// Step 2: 在浏览器中执行工具逻辑
// rem ↔ px 在工具页 JS 中实现