Skip to main content

Aspect ratio calculator API

Enter a width and height to get the simplified ratio, or lock a ratio and change one side to get the other. Each result lists the Instagram, Facebook, LinkedIn, X and other image sizes with the same ratio.

  • Endpoint: POST https://postboost.co/app/api/tools/aspect-ratio-calculator (operationId calculateAspectRatio)
  • Web tool: postboost.co/tools/aspect-ratio-calculator
  • Token: optional (limits)
  • MCP: tool calculate-aspect-ratio on https://postboost.co/mcp/tools

Request​

FieldTypeDefaultDescription
widthintegerWidth in pixels.
heightintegerHeight in pixels.
ratiostringRatio as width:height, e.g. 16:9 or 1.91:1. Give it with width or height to get the other side.

Call it​

curl -X POST https://postboost.co/app/api/tools/aspect-ratio-calculator \
-H 'Content-Type: application/json' \
-d '{"width":1080,"height":1350}'

With a token, send Authorization: Bearer YOUR_API_TOKEN as a default header (how, per SDK).

Response​

{
"ratio": "4:5",
"decimal": 0.8,
"width": 1080,
"height": 1350,
"rounding": null,
"orientation": "portrait",
"matches": [
{
"network": "instagram",
"format": "feed-portrait",
"width": 1080,
"height": 1350,
"ratio": "4:5",
"exact": true
},
{
"network": "facebook",
"format": "feed-image",
"width": 1080,
"height": 1350,
"ratio": "4:5",
"exact": true
},
{
"network": "linkedin",
"format": "single-image-post-vertical",
"width": 720,
"height": 900,
"ratio": "4:5",
"exact": true
},
{
"network": "threads",
"format": "post",
"width": 1080,
"height": 1350,
"ratio": "4:5",
"exact": true
}
]
}

With MCP​

Connect https://postboost.co/mcp/tools (setup) and ask, for example: Calculate an aspect ratio, or the missing side of an image at a given ratio with the PostBoost calculate-aspect-ratio tool.

Errors​

StatusWhen
401The Authorization header holds an invalid token. Leave it out to call as a guest.
413The JSON body is larger than 128 KB.
422A field is invalid; the body lists the errors per field.
429A limit is reached; see limits.