Course contentsShow
← Web Development
Lesson 163 of 2,9823. CSS FundamentalsFree lesson

Angle Units: deg, rad, grad, turn

Learn angle units for transforms, gradients, and animations: degrees, radians, gradients, turns.

Angle Units: deg, rad, grad, turn

You'll learn how CSS measures angles for transforms, gradients, and animations using four different units.

What Are Angle Units?

In CSS, whenever you need to specify a rotation, direction, or circular measurement, you use angle units. Think of a clock face or a compass — angles describe how far around a circle you've turned. CSS gives you four ways to express this rotation:

The Four Angle Units

deg (Degrees) — The most familiar unit. A full circle is 360 degrees, just like in geometry class. 45deg is an eighth of a circle, 90deg is a right angle, and 180deg is halfway around.

turn — The most intuitive unit. One turn equals one complete rotation. 0.5turn is half a circle, 1turn brings you back to the start, and 2turn means two full spins.

rad (Radians) — The mathematician's choice. One full circle equals approximately 6.28rad (technically 2π). You'll rarely use this unless converting from JavaScript math functions. 3.14rad (π) is half a circle.

grad (Gradians) — Rarely used. A full circle is 400 gradians. 100grad equals a right angle. This unit exists mainly for compatibility with certain surveying and European engineering systems.

When You'll Use Them

You'll encounter angle units when rotating elements with transform, creating directional gradients, or animating rotations. All four units are interchangeable — 90deg, 0.25turn, 100grad, and 1.57rad all mean the same thing.

Pro tip: Stick with deg for precision and turn for clarity. They're the most readable and widely understood.

Key Takeaway: CSS measures angles in four units — degrees (360° circle), turns (1 = full rotation), radians (2π circle), and gradians (400 circle) — used for transforms, gradients, and animations.