ForHosting KIT · Images

Resize image by percentage

The percentage resize calculator answers the simplest question in image work: if I scale this picture to 40 percent, how many pixels wide and tall will it be?

● BetaFree · in your browser
Use it from WebAPIEmailTelegramApp soon

You provide the original width and height plus the percentage, and it returns the resulting dimensions rounded to whole pixels, along with the final megapixel count. It is pure arithmetic — no image is uploaded, processed or stored — so it runs instantly in your browser and identically through the API when you need it inside a build script, a thumbnail pipeline or a layout calculation that has to know the exact box an image will occupy before it exists.

Why percentage resizing is deceptively simple

Scaling an image to a percentage looks like one multiplication, but the details decide whether your layout breaks. Each side must be scaled independently and rounded to a whole pixel, because there is no such thing as 640.5 pixels. Round 1920 by 33 percent naively and you get 633.6, which no renderer accepts; this calculator returns 634. The rounding rule matters most on small images: shrinking an 11-pixel icon to 15 percent yields 1.65 pixels, and the honest answer is 2, not a truncated 1 that silently distorts the aspect ratio. Getting these numbers before you touch the image lets you pre-allocate the right canvas size in a thumbnail job, write the correct width and height attributes into your HTML so the page does not reflow when the image loads, and verify that a batch resizer produced what you asked for. The resize image by percentage tool does exactly this math, deterministically, so the answer you see in the browser is byte-for-byte the answer the API returns to your code.

How the calculation works

The formula is one line per dimension: new side equals original side times percentage divided by one hundred, rounded to the nearest whole pixel. A percentage of 50 halves the image, 100 leaves it unchanged, and 250 scales it up two and a half times. Both width and height use the same factor, which is what preserves the aspect ratio — apart from the sub-pixel rounding error that is unavoidable when whole pixels cannot express the exact ratio. The result also includes the megapixel count of the output, which is the number that actually predicts file size and memory cost: scaling to 50 percent does not halve the pixels, it quarters them, because area grows with the square of the sides. The percentage must be positive; zero or a negative value is rejected as invalid input rather than silently producing a zero-dimension image, and a computed side can never fall below one pixel. Every example on this page was generated by running the real handler, so what you read is what you get.

Where it fits in a real workflow

Front-end developers use it to compute responsive srcset entries: from a 2400-pixel master, the 25, 50 and 75 percent variants come out at 600, 1200 and 1800 pixels, and those numbers go straight into the markup. Designers use it when a client asks for a photo at 30 percent for a newsletter and someone has to confirm the result still meets the email template's minimum width. Backend engineers call the API inside pipeline checks, comparing the dimensions a resizer produced against the dimensions it should have produced, and failing the job when they disagree. Because the capability is pure math with no file handling, it costs nothing to run many times: the browser version on this page is free and unlimited, and the API charges only $0.002 per call when you automate it. If you need the pixels themselves transformed rather than the dimensions computed, that is a different capability; this one exists so the planning step is exact, fast and cheap enough to run on every image in the batch.

Plan responsive srcset variants

Compute the exact pixel widths of your 25%, 50% and 75% variants from a master image before writing the markup.

Verify a batch resize job

Compare the dimensions your thumbnail pipeline produced against the dimensions the percentage says it should have produced, and fail the job on mismatch.

Answer a client request precisely

A photo at 30 percent for a newsletter: confirm the result still meets the template's minimum width before exporting anything.

What does it cost?

It is free and unlimited in your browser on this page. Through the API it costs $0.002 per call.

Do I upload an image?

No. You only provide the width, height and percentage. Nothing is uploaded, processed or stored.

How are the dimensions rounded?

Each side is multiplied by the percentage and rounded to the nearest whole pixel. A result can never fall below one pixel.

Can I enlarge an image, not just shrink it?

Yes. A percentage above 100 enlarges the image: 200 doubles each side, 250 scales by two and a half.

Why was my percentage rejected?

The percentage must be a positive number. Zero or negative values are invalid input, and the call is not charged.

Does resizing to 50% halve the number of pixels?

No. It halves each side, which quarters the total pixel count, since area scales with the square of the sides.

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/resize-percentage

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/resize-percentage \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"width":1920,"height":1080,"percentage":50}'
{
  "width": 1920,
  "height": 1080,
  "percentage": 50
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "image.resize_percentage",
  "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 →