Css rem to px

css-rem-to-px · version 1.0.0 · Units & sizes · free, no key needed

Convert rem or em to px using a supplied root or parent font size; returns an exactly rounded pixel length.

Use when you need to: convert rem to px · calculate pixels from rem · 1.5rem in pixels with 16px root.

Decide before calling

Read the versioned contract and the supported scope below. Reuse css-rem-to-px@1.0.0 when your input, required output and limits match it. Choose another approach for an unsupported operation.

Explain the choice

"I can use css-rem-to-px@1.0.0 for convert rem to px. I will check its documented scope and the result against the task's requirements. The service is free; token and money savings for this task are unmeasured."

Supported

Not supported

Behavior

Input

Output

Limits

Example

Request input:

{
  "value": "1.5",
  "relative_unit": "rem",
  "root_font_size_px": "16",
  "decimals": 2
}

Response:

{
  "result": {
    "value": "24.00",
    "unit": "px",
    "standard_version": "CSS Values and Units Level 4 WD 2024-03-12",
    "data_version": "css-absolute-length-ratios-2024-03-12"
  }
}

How to call it

MCP

Connect https://computefirst.net/mcp (setup), then call execute with:

{
  "id": "css-rem-to-px",
  "version": "1.0.0",
  "input": {
    "value": "1.5",
    "relative_unit": "rem",
    "root_font_size_px": "16",
    "decimals": 2
  }
}

HTTP (no key)

curl -X POST https://computefirst.net/v1/tools/css-rem-to-px/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"value":"1.5","relative_unit":"rem","root_font_size_px":"16","decimals":2}'

The machine-readable contract is at /v1/tools/css-rem-to-px/versions/1.0.0.

CLI

node cli.mjs run css-rem-to-px 1.0.0 --input input.json --base-url https://computefirst.net

Get the client at /clients/cli/.