← Back to DevKit

Angle Converter

ANGLE · UNIT CONVERT

Convert between degrees, radians, gradians and turns in real time — handy for CSS rotate and canvas math.

Four-unit live conversion
Degrees deg
Radians rad
Gradians grad
Turns turn
Factors: 1 turn = 360° = 400 grad = 2π rad. Type in any field and the other three update live. CSS rotate accepts deg/grad/rad/turn; Canvas trig uses rad.

>_ USAGE GUIDE

Degrees, radians, gradians and turns each own a corner of front-end work: CSS rotate() accepts all four, Canvas trigonometry takes radians only, and surveying documents occasionally surface gradians. This tool links four input fields — type in any one and the other three update live. The factor chain is worth memorizing: 1 turn = 360° = 400 grad = 2π rad.

  1. Type anywhere: enter a value in any unit field and the rest convert instantly
  2. Feed CSS: results can be used directly as rotate(0.5turn) or rotate(200grad) — modern browsers support all four units
  3. Feed Canvas: values from the rad column plug straight into ctx.rotate() or Math.sin() with no Math.PI / 180 multiplication
  4. No float noise: round trips like 180° → rad → deg never show 180.00000000000003

>_ FAQ

Q1 · How many degrees is one radian?

180/π ≈ 57.2958°, and 1° = π/180 ≈ 0.01745 rad. Useful anchors: 30° = π/6, 45° = π/4, 60° = π/3, 90° = π/2, 180° = π, 360° = 2π — knowing these makes Canvas code readable without constant conversion.

Q2 · Which unit should CSS rotate() use?

Any of them — rotate(45deg), rotate(0.7854rad), rotate(50grad) and rotate(0.125turn) are equivalent. For readability, prefer deg for small angles, turn for half/whole rotations (rotate(0.5turn) says more than 180deg), and rad when the value comes straight out of a math formula.

Q3 · What is a gradian and where is it still used?

A right angle = 100 grad, a full circle = 400 grad. It survives in continental-European surveying and some engineering drawings. You will rarely need it in code, but CAD exports and legacy measurement data do contain it — supporting it prevents the silent error of reading grad as deg, which differs by a factor of 0.9.

Q4 · Why doesn't Math.sin(Math.PI / 2) need conversion?

JavaScript's trigonometric functions always take radians. Degrees must be multiplied by π/180 before any trig call, and results from Math.atan2 come back in radians — convert to deg before handing them to CSS. The rad column of this tool can be used as code as-is.

Q5 · Why do results have long decimal tails?

That is expected: π is irrational, so radian–degree conversion has no exact finite decimal representation in either direction. The tool trims display to 10 significant digits and suppresses round-trip float noise; for maximum precision keep rad as the source of truth (symbolically exact) and format only for display.

Embed code

Paste the code below into your page to embed this tool as an iframe (nav and footer auto-hidden).

Heightpx
This tool runs entirely in your browser — input never leaves your device. Press Ctrl K to switch tools anytime.