Arccos calculator
The inverse cosine of 0.5 is 60 degrees, or 1.047197551197 radians. Enter any value from -1 to 1 and get the one angle between 0 and 180 degrees with that cosine, in radians, degrees or both. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Value
- 0.5 both
- Radians
- 1.0471975512
- Degrees
- 60
The arccos calculator computes the inverse cosine of any value between -1 and 1 and returns the corresponding angle in radians, degrees, or both. It answers the question trigonometry asks most often: cosine gave me this number — which angle produced it? The result always lands on the principal branch, from 0 to π radians (0 to 180 degrees), which is the convention every textbook, navigation formula and physics derivation assumes.
What arccos actually computes
Cosine maps an angle to a number between -1 and 1; arccos is the inverse journey: it takes that number and hands you back the angle. Because cosine is not one-to-one — infinitely many angles share the same cosine — the inverse is defined on a single principal branch: arccos(x) always returns the unique angle in [0, π] radians, that is, 0 to 180 degrees, whose cosine equals x. So arccos(1) is 0, arccos(0) is π/2 (90 degrees), arccos(0.5) is π/3 (60 degrees) and arccos(-1) is π (180 degrees).
This calculator returns that principal value with full double precision and rounds the published output to twelve decimal places so results are byte-stable across machines.
Radians, degrees, or both
The unit parameter controls the shape of the answer. Pass 'radians' and you get only the radian measure, which is what calculus, physics and most programming languages expect — JavaScript's Math.acos, Python's math.acos and C's acos all speak radians natively. Pass 'degrees' and you get the angle in degrees, the unit surveyors, navigators and school geometry actually use.
Pass 'both' — the default — and you get the two representations in a single response, converted through the exact identity degrees = radians × 180 / π, which saves a second call when a report needs one unit and the code behind it needs the other. Choosing the unit at the source avoids the classic double-conversion bug where a rounded degree value is converted back to radians and drifts from the true answer.
If you omit the parameter entirely, the default 'both' applies, so the simplest possible request — just a value — already returns a complete answer: the echo of your input plus the angle in each unit.
What you can do with it
Angle between two vectors
Compute the dot product of two normalized vectors and pass it to arccos to recover the angle between them in degrees or radians.
Great-circle distance on Earth
Apply the spherical law of cosines between two lat/lon points and invert the cosine term to get the central angle of the route.
FAQ
What inputs are accepted?
Any finite number from -1 to 1 inclusive.
Why is 1.2 rejected if arccos exists in complex numbers?
Because real-valued angles never produce |cos| > 1. This calculator returns real angles only, so out-of-domain input is an error, not a complex result.
What units can I get?
Radians, degrees, or both at once. The default is 'both', and the degree value is derived exactly as radians × 180 / π.
Is my input stored?
No. The value is used for the calculation and discarded; only the computed angle is returned.
How do I find the angle between two vectors with arccos?
Normalize both vectors, take their dot product and enter that number here. The inverse cosine of the dot product is the angle between the two vectors, in degrees or radians as you prefer.
Related tools
For developers — API access
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.
API endpoint
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.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/math/arccos \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"value":0.5}'const res = await fetch("https://api.kit.forhosting.com/math/arccos", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"value": 0.5
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/math/arccos",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"value": 0.5
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/math/arccos", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"value":0.5}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"value":0.5}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/math/arccos", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"value": 0.5
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "math.arccos",
"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.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
Send a value outside the valid domain and the API rejects it with a clear invalid_input error instead of returning NaN, so automated pipelines fail loudly and early. The exact same code runs free in your browser on this page; you only pay $0.002 per request when you call it through the API.
What arccos actually computes
The input must be a finite number inside the closed interval [-1, 1]; anything outside it has no real arccos — the cosine of a real angle can never reach 1.1 or -2 — and the calculator says so with an invalid_input error naming the offending value rather than silently emitting NaN. That strictness matters when the input came from a longer computation: a distance formula or a dot product that drifted a hair past 1 due to rounding should be caught and clamped deliberately by you, not hidden.
Radians, degrees, or both
Every response echoes the value you sent, which makes results self-describing when they are logged or stored for an audit trail.
Where it fits and what it costs
Inverse cosine appears wherever an angle must be recovered from a ratio: turning a dot product into the angle between two vectors, extracting the central angle between two points on a sphere with the haversine formula, solving triangles with the law of cosines, computing joint angles in robotics, or reversing a cosine similarity in a search ranking. In all of those the arithmetic is trivial but the validation is not: floating-point drift can push a mathematically valid input to 1.0000000002, and a library that returns NaN lets that error propagate silently through every downstream step. This endpoint fails fast instead, so the mistake surfaces at the boundary where it was made. It runs as a pure calculation on our global edge with nothing stored after the response, and the identical module powers the free calculator on this page, so the browser and the API can never disagree. Browser use is free and unlimited; API calls cost $0.002 per request with no per-unit surcharge, which makes it practical to validate every call in a pipeline rather than sampling a few.
Integration use cases
Catch floating-point drift early
Send every computed cosine through the API: inputs that drift just past 1 are rejected loudly instead of propagating NaN downstream.
Technical questions
What does it cost?
$0.002 per request via the API. It is also free and unlimited to run in your browser on this page.
Which angle does it return when several share a cosine?
Always the principal value: the unique angle in [0, π] radians, i.e. 0 to 180 degrees, with that cosine.