ForHosting KIT · Images

Resize image for social platform

Preparing one image for several social networks is less about scaling than choosing the correct frame.

● BetaFree · in your browser
Use it from WebAPIEmailTelegramApp soon

This calculator accepts the source width and height, plus a supported platform and placement, then returns the largest centered crop that matches the placement’s required aspect ratio. It also identifies the preset dimensions and reports how much would be removed from every edge. No image is uploaded, decoded, resized, or changed. The result is reusable crop geometry for an editor, image library, build script, content pipeline, or preview interface.

Choose the destination before calculating the crop

Start with the pixel width and height of the actual source image, then select its destination platform and placement. A general Instagram post, an Instagram story, a Twitter header, and a LinkedIn banner occupy very different frames even when they use the same photograph. The calculator joins the two destination fields into a known preset, looks up that preset’s published target dimensions, and derives its aspect ratio. It then finds the largest rectangle with that ratio that fits entirely inside the source. If the original is too wide, the full height is retained and equal strips are removed from the left and right. If it is too tall, the full width is retained and equal strips are removed from the top and bottom. The response includes the normalized platform and placement, preset name, target width and height, numerical aspect ratio, crop rectangle, and removed margins. Those values let a person preview the change or let software apply it without maintaining another table of social dimensions.

Understand what the coordinates mean

The crop object uses the common top-left coordinate system: x increases from left to right, and y increases from top to bottom. Its width and height describe the source region to preserve, not the final exported resolution. The removed object presents the same decision as margins on all four sides, which is often easier to display in a user interface or audit log. Because the crop is centered, opposite margins are equal. Some combinations of source dimensions and target ratio produce fractional coordinates or dimensions. That is intentional: the exact center or exact ratio can fall between physical pixels. Keeping precise values avoids silently imposing a rounding policy that might differ between Sharp, ImageMagick, Canvas, a mobile graphics framework, or a hosted media service. If the next tool requires integer pixels, apply that tool’s documented rounding behavior at the final crop step. After cropping, resize the preserved region to the returned target width and height if the platform requires those exact output dimensions. This capability calculates geometry only; it never stretches, pads, resamples, or edits image data.

Use strict presets to keep automated publishing predictable

A platform name alone is not enough because each network offers several placements with unrelated shapes. The calculator therefore accepts only explicit supported platform and placement combinations. Unknown combinations return an invalid-input error instead of guessing a ratio, falling back to a generic square, or producing an asset that may be rejected later. This behavior is especially useful in automated publishing, where a misspelled destination should stop a job before hundreds of incorrectly framed images are generated. Store the returned preset and target dimensions beside the derived asset so future maintainers can see which rule was applied. Review a centered preview whenever the subject is close to an edge, since a mathematically correct crop cannot know which face, logo, product, or caption matters most. In that situation, use the returned width and height as the valid frame size but let an editor shift x or y while keeping the rectangle within the source. The calculation uses no network, clock, randomness, image analysis, or hidden state, so identical inputs always produce identical output and can be cached safely.

Prepare a campaign image for several networks

Calculate a separate centered frame for each destination before rendering channel-specific assets.

Validate an automated publishing job

Reject an unsupported platform and placement pair before an image processor creates the wrong shape.

Build a crop preview

Overlay the returned rectangle and removed margins on a source image before an editor approves the framing.

Does this tool upload or resize my image?

No. It receives dimensions and destination names only, then returns crop geometry. It does not receive, decode, store, or alter image pixels.

How much does the API calculation cost?

The API price is $0.002 per request. The browser version performs the same deterministic calculation locally.

Why are some crop values decimals?

An exact centered ratio can fall between physical pixels. Decimal geometry preserves the mathematical frame until your image processor applies its rounding policy.

What happens for an unknown platform or placement?

The request fails with an invalid-input error. The calculator never guesses a ratio for an unsupported platform and placement combination.

Does the crop keep the important subject in frame?

It centers the largest matching rectangle but does not analyze image content. Preview the result and shift the frame in your editor when a subject is off-center.

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.

POSThttps://api.kit.forhosting.com/image/social-preset-resize

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.

curl -X POST https://api.kit.forhosting.com/image/social-preset-resize \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"width":2400,"height":1600,"platform":"instagram","placement":"post"}'
{
  "width": 2400,
  "height": 1600,
  "platform": "instagram",
  "placement": "post"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "image.social_preset_resize",
  "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.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

max_mb15
max_megapixels12
HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Read the full KIT documentation →