Portrait aspect ratio calculator
A 1080 × 1350 portrait reduces to 4:5, because both sides divide by 270. Enter the width and height of any taller-than-wide image and get its simplified ratio and its decimal, ready to label posts, stories, prints and wallpapers. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Width
- 1,080
- Height
- 1,350
- Gcd
- 270
- Ratio w
- 4
- Ratio h
- 5
- Ratio
- 4:5
Portrait photographs, Instagram feed posts, phone wallpapers, and vertical video covers are defined by a taller-than-wide frame. Designers, social managers, and print labs need the simplified width-to-height ratio of that frame — 4:5, 9:16, 2:3 — not the raw pixel counts sitting in a file name. This portrait aspect ratio calculator takes the width and height of a portrait image in pixels, checks that both values are positive integers and that the image is actually portrait (height strictly greater than width), divides both sides by their greatest common divisor, and returns the reduced ratio such as 4:5 together with the decimal width over height. Landscape and square sizes are rejected because they are a different search and a different crop.
What a portrait aspect ratio is and why 4:5 keeps showing up
The aspect ratio of an image is the reduced pair of integers that describe width relative to height after cancelling their greatest common divisor. For a portrait frame the second term is larger than the first, which is why Instagram still-life posts are 4:5, a four-by-six print is 2:3, a classic camera JPEG is 3:4, and a full-bleed phone story is 9:16.
Raw pixel counts hide that identity: 1080 by 1350, 1440 by 1800, and 2160 by 2700 are the same 4:5 portrait, and treating them as different sizes is how crops drift between a DAM, a CDN, and a social scheduler. Euclidean GCD is the textbook reduction: the gcd of 1080 and 1350 is 270, so 1080 divided by 270 by 1350 divided by 270 is 4 by 5. This calculator only answers that portrait question.
It does not scale the image, pick a crop origin, or convert a landscape 16:9 master into a 9:16 story — those are different jobs and different search terms. Square 1:1 avatars are also out of scope, because a square is not taller than it is wide. Designers who paste EXIF width and height from a camera JPEG, or developers who already know the decoded buffer size, get a stable ratio string they can store, compare, and display next to a thumbnail without pulling an image library into a worker.
The decimal field is simply width divided by height, so 4:5 reports 0.8 and 9:16 reports 0.5625, which is handy when a stylesheet needs a CSS aspect-ratio value rather than a colon pair.
Who labels portrait sizes, and why
Social teams use a portrait aspect ratio calculator so a 1080 by 1350 Instagram still, a 1080 by 1920 Reel cover, and a 1200 by 1800 Pinterest pin can be labelled 4:5, 9:16, and 2:3 before they enter a publishing calendar. Print labs converting a digital file to a five-by-seven or four-by-six paper size need the reduced pair to choose a mat and to warn when a 3:4 phone JPEG will crop more than a 2:3 DSLR frame.
DAM and CDN pipelines store the ratio string next to width and height so a later variant job can pick a portrait template without decoding the bytes again. Classroom photography modules ask students to classify frames as 4:5, 3:4, or 9:16; a deterministic oracle that rejects landscape input is more honest than a generic ratio tool that would happily return 16:9 for a widescreen still. Failed validation does not consume balance.
What you can do with it
Instagram and Stories crop checks
Confirm that a 1080 by 1350 still is 4:5 and a 1080 by 1920 cover is 9:16 before a post goes into the publishing calendar.
Print lab paper matching
Map a digital portrait to 2:3 or 5:7 paper so the lab can warn when a 3:4 phone JPEG will crop more than a 2:3 camera frame.
DAM metadata without decoding pixels
Store the reduced ratio next to width and height so a later variant job can pick a portrait template without opening the file again.
FAQ
How do I get the aspect ratio of a portrait image?
Send positive integers width and height, with height greater than width.
Which common portrait ratios does this cover?
Any taller-than-wide pixel pair reduces correctly: 4:5 Instagram portraits, 9:16 Stories and Reels, 2:3 prints, 3:4 camera JPEGs, 5:7 paper, and odd custom sizes alike.
What happens if I enter a landscape or square size?
It is rejected. A 1920 by 1080 or 1080 by 1080 image is not a portrait, and the calculator will not swap the sides, because that would misreport the orientation you asked to measure.
Are 1080 × 1350 and 2160 × 2700 the same ratio?
Yes. Both reduce to 4:5, and so does 1440 × 1800. Labelling them with the same ratio keeps crops consistent when one picture travels between tools in different sizes.
What does the decimal value mean?
It is the width divided by the height, so 4:5 gives 0.8 and 9:16 gives 0.5625. A single number is handy when a style sheet wants one value instead of a colon pair.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/image/portrait-aspect-ratio \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"width":1080,"height":1350}'const res = await fetch("https://api.kit.forhosting.com/image/portrait-aspect-ratio", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"width": 1080,
"height": 1350
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/image/portrait-aspect-ratio",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"width": 1080,
"height": 1350
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/image/portrait-aspect-ratio", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"width":1080,"height":1350}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"width":1080,"height":1350}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/image/portrait-aspect-ratio", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"width": 1080,
"height": 1350
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "image.portrait_aspect_ratio",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Limits
max_px | 100000000 |
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
Input contract, response shape, and error behaviour
Both dimensions are capped at one hundred million pixels on a side so a malformed upload cannot push the arithmetic outside the safe integer range. Units are pixels; the calculator never infers centimetres or print inches from DPI. POST a JSON body with two required positive integers: width, the horizontal pixel count of the portrait, and height, the vertical pixel count. Each field may arrive as a JSON integer or as a digit string; non-integers, zeros, negatives, empty strings, and missing fields fail with invalid_input naming the field. Height must be strictly greater than width: a landscape 1920 by 1080 or a square 1080 by 1080 is not a portrait image, and the task fails rather than quietly swapping the terms, because swapping would lie about the orientation the caller asked to measure. On success the body echoes width and height, reports the gcd used to reduce them, returns ratio_w and ratio_h as the reduced integers, ratio as the colon-separated string such as 4:5, decimal as width divided by height rounded to twelve places for stable goldens, orientation as the constant portrait, and a formula string restating the GCD reduction. Example: width 1080 and height 1350 yield gcd 270, ratio_w 4, ratio_h 5, ratio 4:5, and decimal 0.8. Pair the response with your own cropper if you need to fit a master into that ratio; this endpoint only names the ratio of the pixels you already have. Failed validation is not billed, so a probe that sends a landscape size to confirm the portrait guard does not consume prepaid balance.
Technical questions
What happens if I send a landscape size such as 1920 by 1080?
The task fails with invalid_input. This calculator only names portrait frames; a landscape or square size is a different orientation and is not silently swapped.
Why must width and height be positive integers?
Pixel counts are whole numbers. Zero, negatives, and fractional dimensions are not a real image size, so they fail with invalid_input naming the field and are not billed.
What does the portrait aspect ratio calculator cost?
The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.