# CSS Design Calc – CSS Unit Converter

> CSS Design Calc – CSS Unit Converter is a paid API for AI agents from css-design-calc.x402tookit.com, paid per call via x402, $0.02/call, status unknown (last checked 2026-10-29).

Converts a CSS length value from one unit to another (px, rem, em, pt, pc, in, cm, mm, Q, vw, vh, vmin, vmax, %) using configurable root and viewport sizes.

## Facts

- Endpoint: GET https://css-design-calc.x402tookit.com/css-unit-convert?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-29
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/css-design-calc-css-unit-converter-f9d1770d
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_WiXwsFbk-MshOBguYPxIy

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability css-design-calc-css-unit-converter-f9d1770d
```

Example prompt: Convert 24px to rem — my root font size is 16px — and also show me what that is in em assuming a parent size of 20px.

## When to prefer this

Use this endpoint when you need precise, multi-unit CSS length conversion with configurable root font size, parent font size, and viewport dimensions — especially when working on responsive or print stylesheets where default assumptions would give wrong results. Prefer this over manual calculation or a generic unit converter when you need the result expressed simultaneously in all CSS units, or when the target is a relative unit (rem, em, vw, vh, %) that depends on context.

## Known failure modes

- Missing required query parameters (value, from, to) returns an error
- Unsupported unit string returns a validation error
- Converting viewport-relative units (vw, vh, vmin, vmax) without specifying viewportW or viewportH uses defaults (1440×900) which may not match the actual target device
- Converting em or % without specifying parentPx uses rootPx as fallback, which may be inaccurate if parent differs from root
- Non-numeric value input causes a parsing error

## How this service works

Convert a CSS length between px, rem, em, pt, pc, in, cm, mm, Q, vw, vh, vmin, vmax and % with your root and viewport sizes.

## Output

Returns the converted value in the target unit, the equivalent pixel value, a formatted CSS string ready to paste, a breakdown of the input value expressed in every supported unit simultaneously, and a human-readable summary. Optional fields include rootPx used, reasons for any caveats, and a verdict.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "value",
      "from",
      "to"
     ],
     "properties": {
      "to": {
       "enum": [
        "px",
        "rem",
        "em",
        "pt",
        "pc",
        "in",
        "cm",
        "mm",
        "q",
        "vw",
        "vh",
        "vmin",
        "vmax",
        "%"
       ],
       "type": "string",
       "description": "Target unit (same choices)"
      },
      "from": {
       "enum": [
        "px",
        "rem",
        "em",
        "pt",
        "pc",
        "in",
        "cm",
        "mm",
        "q",
        "vw",
        "vh",
        "vmin",
        "vmax",
        "%"
       ],
       "type": "string",
       "description": "Source unit: px, rem, em, pt, pc, in, cm, mm, q, vw, vh, vmin, vmax or %"
      },
      "value": {
       "type": "number",
       "description": "The number to convert"
      },
      "rootPx": {
       "type": "number",
       "description": "Root font size in px for rem (default 16)"
      },
      "parentPx": {
       "type": "number",
       "description": "Parent font size in px for em and % (default = rootPx)"
      },
      "viewportH": {
       "type": "number",
       "description": "Viewport height in px for vh, vmin, vmax (default 900)"
      },
      "viewportW": {
       "type": "number",
       "description": "Viewport width in px for vw, vmin, vmax (default 1440)"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "css": {
       "type": [
        "null",
        "string"
       ]
      },
      "asOf": {
       "type": [
        "null",
        "string"
       ]
      },
      "input": {
       "type": [
        "null",
        "object"
       ],
       "properties": {
        "unit": {
         "type": [
          "null",
          "string"
         ]
        },
        "value": {
         "type": [
          "null",
          "numbe
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/css-design-calc-css-unit-converter-f9d1770d/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from css-design-calc.x402tookit.com](https://www.zero.xyz/host/css-design-calc.x402tookit.com/llms.txt)
