ForHosting KIT · Math

Area calculator

A circle with a radius of 2 covers 12.566371 square units, and a 5-by-3 rectangle covers 15. Pick a square, rectangle, triangle or circle, enter only the measurements it needs and get the area in the unit you measured with, squared. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Shape
Circle
Radius
2
You get
Area
12.566371

The area calculator takes the name of a common shape and the dimensions that define it — a side for a square, length and width for a rectangle, base and height for a triangle, or a radius for a circle — and returns the exact area in a single call.

One tool for the four shapes people measure most

Most area questions in real life are about four shapes: a square plot, a rectangular room, a triangular gable or a round table. Instead of shipping four separate calculators, this capability accepts a shape field and asks only for the dimensions that shape needs. A square needs one side; a rectangle needs length and width; a triangle needs its base and the perpendicular height; a circle needs its radius.

Anything else you send is ignored, anything missing is reported by name. Because the formulas are elementary and exact, the result needs no approximation disclaimers: a 5-by-3 rectangle is 15 square units, here and everywhere, in any unit system you choose to feed it.

How validation works before any arithmetic happens

Every dimension must be a positive, finite number. The shape itself must be one of the four supported values, matched case-insensitively; anything else returns an unsupported-shape error listing what is accepted. This strictness is deliberate.

An area of zero usually means a typo, not a real measurement, and silently computing with a negative width would produce a plausible-looking nonsense number that is far worse than an honest rejection. Bad input is never billed: validation happens first, and only a successful computation counts as a task.

Units, precision and where it fits in a workflow

The calculator is unit-agnostic on purpose: it multiplies whatever numbers you give it, so if you send centimeters you get square centimeters and if you send feet you get square feet. Keep your dimensions in one consistent unit and convert beforehand if they are not. Typical integrations call it as a step inside a quoting or estimation pipeline: a flooring service prices a room, a gardening tool sizes a lawn, a school platform checks homework answers.

Quote flooring or paint jobs

Turn a customer's room length and width into square meters inside an automated estimate, with invalid measurements rejected before they reach a price.

Build a homework or tutoring checker

Compare a student's answer for the area of a triangle or circle against the exact computed value, including a clear explanation of which dimension was wrong.

Size land, fabric or material cuts

Compute the area of square plots, rectangular panels or circular cuts from the measurements you already have, in whatever unit you measure with.

Which shapes are supported?

Square, rectangle, triangle and circle. The shape field is matched case-insensitively; anything else returns an error listing the supported shapes.

Which dimensions does each shape need?

A square needs side; a rectangle needs length and width; a triangle needs base and height; a circle needs radius. Extra fields are ignored.

What units does the result use?

Whatever unit you send, squared. Send centimeters and you get square centimeters; send feet and you get square feet. Keep all dimensions in the same unit.

Why is a measurement of zero rejected?

An area of zero almost always means a typo rather than a real measurement, and a negative width would give a plausible-looking but meaningless number. The calculator stops instead and names the measurement that needs fixing.

What if my measurements are in different units?

Convert them to one unit before you start. The calculator simply multiplies the numbers you give it, so mixing centimeters and meters would produce a wrong area without any warning.

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/math/area

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/math/area \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"shape":"circle"}'
{
  "shape": "circle"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "math.area",
  "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.

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.

It validates every dimension, rejects zero and negative values with a clear message naming the offending field, and answers deterministically, so the same request always produces the same number whether it runs on the API or free in your browser.

One endpoint for the four shapes people actually measure

The response echoes the dimensions it used together with the area and the formula applied, so a calling program — or a person reading a log — can verify the result against the inputs without guessing which numbers went into it.

How validation works before any arithmetic happens

A missing field, a non-numeric string, zero or a negative value all stop the request before the formula runs, and the error message names the exact field at fault — for example that the radius must be a positive number — so a form can highlight the right input instead of showing a generic failure.

What happens with zero or negative dimensions?

The request is rejected with an invalid_input error naming the field, before any computation — and invalid input is never billed.

What does it cost?

$0.002 per request. It is also free to run in your browser on this page, with the same code and the same result.

How precise is the result?

Areas are computed exactly and rounded to six decimal places, so the output is deterministic and identical across the API and the browser runner.

Read the full KIT documentation →