ForHosting KIT · Math

Pie chart angles from values free online

Values 1, 1 and 2 add up to 4, so they become a quarter, a quarter and half of the circle. Enter any list of values or weights to get each slice's angle in degrees, adding up to exactly 360, and its percentage. 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
Slice values
1, 1, 2
You get
Total
4
Angle (degrees)
90, 90, 180
Share of the circle (%)
25, 25, 50

Converts sector values or weights into pie-chart degrees that sum to 360 and percentages that sum to 100. Free, deterministic, and private in your browser.

From numbers to slices of a circle

A pie chart splits the full turn of a circle, 360 degrees, in proportion to the values it shows. Each slice gets its value divided by the total, multiplied by 360. With the values 1, 1 and 2 the total is 4, so the first two slices each take a quarter of the circle and the last one takes half. The same share multiplied by 100 instead of 360 gives the percentage printed in the legend. The calculator returns both lists at once, so the angles you draw and the percentages you label always describe the same split.

Why the slices close the circle, and what to watch

When values do not divide evenly, rounding each angle on its own can leave a sliver missing or overlapping. Here the last slice absorbs that small rounding remainder, so the angles always add up to exactly 360 degrees and the percentages to 100. Use it to check homework, to prepare a chart by hand with a protractor or to verify a spreadsheet. The usual mistakes are forgetting to divide by the total, mixing percentages with raw counts in the same list, and entering an empty list or one whose total is zero, which the calculator refuses.

Homework and exams

Check classic quantitative problems quickly with stable, reproducible answers.

Automation

Call the same pure function from scripts without installing a spreadsheet or CAS.

Is this free?

Yes. Tier A runs entirely in your browser without an account.

How do I turn values into pie chart angles?

Divide each value by the total and multiply by 360. Each slice then takes the same share of the circle as its value takes of the sum, and the calculator does this for the whole list at once.

Why do the angles always add up to exactly 360?

Because the small remainder left by rounding is given to the last slice. That way the chart has no gap and no overlap when you draw it, and the percentages add up to 100 as well.

Do my values need to be percentages?

No. You can enter counts, measurements or weights on any scale, as long as the total is above zero. The calculator returns the angles and also the percentage of each slice, which add up to 100.

What happens if the list is empty or the total is zero?

The calculation is refused. An empty list has nothing to split, and a total of zero or less cannot be shared out as parts of a circle, so you get a clear message instead of a broken chart.

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/pie-chart-angles

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/pie-chart-angles \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"values":[1,1,2]}'
{
  "values": [
    1,
    1,
    2
  ]
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "math.pie_chart_angles",
  "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.

How it works

Each angle is value/total times 360 degrees. The last sector absorbs rounding residue so the sum stays exactly 360. The implementation is fully deterministic and runs free in the browser with the same pure function as the API path. Inputs are validated before any arithmetic so wrong types and out-of-range values become clear invalid_input errors instead of silent NaN results. The implementation is fully deterministic and runs free in the browser with the same pure function as the API path. Inputs are validated before any arithmetic so wrong types and out-of-range values become clear invalid_input errors instead of silent NaN results.

Inputs and outputs

Required fields must be present and correctly typed. Optional fields use documented defaults. Error messages use stable English match substrings for the harness. Converts sector values or weights into pie-chart degrees that sum to 360 and percentages that sum to 100. Provide the fields listed in the input schema. The success payload always includes the primary result fields named in the output schema so clients can bind UI metrics without guessing. The implementation is fully deterministic and runs free in the browser with the same pure function as the API path. Inputs are validated before any arithmetic so wrong types and out-of-range values become clear invalid_input errors instead of silent NaN results.

Edge cases and limits

Rejects empty arrays and non-positive totals. Empty or contradictory ranges are rejected early. Extremely large intermediate values that overflow IEEE-754 become an out-of-range error rather than null fields. The implementation is fully deterministic and runs free in the browser with the same pure function as the API path. Inputs are validated before any arithmetic so wrong types and out-of-range values become clear invalid_input errors instead of silent NaN results. The implementation is fully deterministic and runs free in the browser with the same pure function as the API path. Inputs are validated before any arithmetic so wrong types and out-of-range values become clear invalid_input errors instead of silent NaN results.

Teaching demos

Show worked examples with golden fixtures that match the free widget and the API.

Does it call the network?

No. The parse engine keeps everything on-device.

What if my input is invalid?

You receive invalid_input with a clear English message.

Are results stable?

Yes. Deterministic math and golden examples freeze the contract.

Who authors this capacity?

samurai on the ForHosting KIT workshop.

Read the full KIT documentation →