ForHosting KIT · Images

Generate thumbnail sizes

This thumbnail size generator turns one source image size into a ready-to-use set of thumbnail dimensions.

● BetaFree · in your browser
Use it from WebAPIEmailTelegramApp soon

Enter the original width and height, add every output width you need, and receive the matching pixel heights in the same order. Each height is calculated from the source aspect ratio and rounded to the nearest whole pixel. It is useful for planning responsive images, documenting media requirements, preparing resize jobs, and keeping repeated calculations consistent across a team or automated workflow.

Start with the source image and the widths you need

Provide the original image width and height as positive whole numbers measured in pixels. Then supply a list containing at least one target width. The calculator accepts up to one hundred widths in a request, which is enough for detailed responsive image sets, content management presets, or marketplace asset lists without creating an unbounded job. The order is meaningful: results appear in exactly the same order as the requested widths, and repeated widths remain repeated. This makes the response easy to pair with an existing list of breakpoint names or export tasks. Use the actual pixel dimensions of the source rather than a simplified ratio whenever possible. A 4032 by 3024 photograph and a 4 by 3 ratio describe the same shape, but real dimensions make the request clearer to reviewers and reduce the chance that width and height are accidentally reversed. Every dimension must be a positive integer. Zero, negative values, decimals, strings, missing dimensions, an empty width list, and lists longer than the stated limit are rejected instead of being silently corrected.

Understand how each thumbnail height is calculated

For every target width, the calculator multiplies that width by the original height and divides by the original width. This applies one constant scale factor to both axes, so the source aspect ratio is preserved and the image will not be stretched or squeezed. Pixel dimensions must be whole numbers, so each calculated height is rounded to the nearest integer with the standard JavaScript rounding rule. For example, a 1920 by 1080 source requested at 800 pixels wide produces a height of 450 pixels. Some source ratios and target widths produce fractional heights; rounding can make the displayed ratio differ by a tiny fraction of a pixel, which is unavoidable for raster output. The response includes the source dimensions, the numeric width-to-height aspect ratio, and a thumbnail record for each requested width. This capability calculates dimensions only. It does not download, inspect, crop, compress, sharpen, or resize an image, and it does not guarantee that enlarging a small source will produce acceptable visual quality.

Use the result in responsive and automated workflows

The returned thumbnail array can feed an image processing queue, a build script, a design handoff, or a content management configuration. A frontend team might request widths that match layout breakpoints and use the calculated values to reserve space before images load. A publishing team might store the records beside a media asset so editors know the exact dimensions required from a separate resizing tool. An API integration can generate the plan first, validate it, and then submit each record to an image transformation service. Because the algorithm is deterministic and uses no network, random values, or current time, the same valid input always returns the same output. Keep in mind that this tool preserves the full source shape; it does not create fixed-ratio crops such as square avatars or social preview cards. If a destination requires exact width and height values that use a different aspect ratio, choose a cropping workflow instead. The API price is $0.002 per request, regardless of how many permitted target widths are included.

Plan a responsive image set

Calculate matching heights for every frontend breakpoint before generating srcset image variants.

Define CMS thumbnail presets

Turn a source asset ratio and a list of editorial widths into consistent whole-pixel dimensions.

Prepare batch resize jobs

Create an ordered dimension plan that another image processing tool can execute without repeating ratio math.

What does it cost?

The API costs $0.002 per request, and the calculator can also run in the browser.

How is each height calculated?

Each target width is multiplied by the source height and divided by the source width, then rounded to the nearest whole pixel.

Does this tool resize the image?

No. It returns a dimension plan only; it does not read, upload, crop, or transform image pixels.

Can I submit an empty list of target widths?

No. At least one target width is required, and an empty list returns an invalid input error.

Are duplicate target widths removed?

No. Input order and duplicates are preserved so each output record corresponds directly to the requested list.

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/thumbnail-set

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/thumbnail-set \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"width":1920,"height":1080,"target_widths":[1200,800,320]}'
{
  "width": 1920,
  "height": 1080,
  "target_widths": [
    1200,
    800,
    320
  ]
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "image.thumbnail_set",
  "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 →