# CSS Design Calc – Aspect Ratio Calculator

> CSS Design Calc – Aspect Ratio Calculator 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-30).

Calculates the simplified aspect ratio of a width/height pair, or derives the missing dimension from a known ratio, and returns CSS-ready values including css-aspect-ratio and padding-top percent.

## Facts

- Endpoint: GET https://css-design-calc.x402tookit.com/aspect-ratio?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-30
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/css-design-calc-aspect-ratio-calculator-f7d0decf
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_eA-frvx3wIB3DvBc-ovgg

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-aspect-ratio-calculator-f7d0decf
```

Example prompt: What is the simplified aspect ratio for an image that's 1920px wide and 1080px tall, and give me the CSS aspect-ratio value and padding-top percentage I can use in my stylesheet?

## When to prefer this

Choose this endpoint when you need CSS-specific aspect ratio outputs (the css-aspect-ratio string and padding-top percent) rather than a plain ratio simplification. It is particularly useful when building responsive layouts and needing to cross-reference against common named ratios like 16:9, 4:3, or 3:2 in a single call. Prefer this over generic math tools when the output needs to feed directly into CSS properties.

## Known failure modes

- Missing both ratio and at least one dimension — returns error or empty result
- Ratio string in unrecognised format — may fail to parse
- Width or height of zero or negative — undefined mathematical result
- Providing only a ratio with no width or height — cannot derive a missing side
- Network or service downtime — HTTP error response

## How this service works

Aspect ratio of a width and height (simplified, nearest common ratio) or the missing side for a ratio, with CSS values.

## Output

Returns the simplified ratio (e.g. '16:9'), nearest common ratio from a list of standard ratios, how close the input is to that common ratio as a percentage difference, the CSS aspect-ratio property string (e.g. '16 / 9'), the padding-top percent for the old percentage-padding responsive trick, the ratio as a decimal number, orientation (landscape/portrait/square), and optionally the derived missing side when only one dimension and a ratio are supplied.

## 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": [],
     "properties": {
      "ratio": {
       "type": "string",
       "description": "Ratio such as 16:9, 4/3 or 1.778 (with width or height to find the other side)"
      },
      "width": {
       "type": "number",
       "description": "Width in any unit"
      },
      "height": {
       "type": "number",
       "description": "Height in any unit"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "asOf": {
       "type": [
        "null",
        "string"
       ]
      },
      "width": {
       "type": [
        "null",
        "number"
       ]
      },
      "height": {
       "type": [
        "null",
        "number"
       ]
      },
      "source": {
       "type": [
        "null",
        "string"
       ]
      },
      "reasons": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "string"
       }
      },
      "summary": {
       "type": [
        "null",
        "string"
       ]
      },
      "verdict": {
       "type": [
        "null",
        "string"
       ]
      },
      "degraded": {
       "type": [
        "boolean",
        "null"
       ]
      },
      "disclaimer": {
       "type": [
        "null",
        "string"
       ]
      },
      "notChecked": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "string"
       }
      },
      "simplified": {
       "type": [
        "null",
        "string"
       ]
      },
      "derivedSide": {},
      "orientation": {
       "type": [
        "null",
        "string"
       ]
      },
      "commonRatios": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "string"
       }
      },
      "ratioDecimal": {
       "type": [
        "null",
        "number"
       ]
      },
      "cssAspectRatio": {
       "
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/css-design-calc-aspect-ratio-calculator-f7d0decf/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)
