🧮
🧮 Math & statistics

Quaternion Calculator (add, multiply, divide, norm, inverse & rotation)

Results update as you type.

Your numbers

Understanding the quaternion calculator — concept and principle

This calculator adds, subtracts, multiplies and divides quaternions, and gives the conjugate, norm, inverse and unit form of the first quaternion together with the rotation angle and axis it represents. Use it for 3D graphics, game development, robotics, aerospace attitude control and abstract algebra courses.

Quaternion productij = k but ji = −kq₁1 + 2i + 3j + 4kq₂5 − 6i + 7j + 8kw = 5 + 12 − 21 − 32 = −36x 0 · y −18 · z 60q₁ × q₂−36 − 18j + 60k|q₁q₂| = |q₁||q₂|72.2496q₁ as a rotation: 158.96° about (0.37, 0.56, 0.74)
Multiplying with Hamilton’s rules gives −36 − 18j + 60k; swapping the order would change it.

How it is calculated

A quaternion is q = w + xi + yj + zk with i² = j² = k² = ijk = −1.

The principle

William Rowan Hamilton found in 1843 that numbers with one real and three imaginary parts could be multiplied consistently if multiplication was allowed to depend on order: ij = k but ji = −k. Quaternions form a number system in which every non-zero element has an inverse, and the norm of a product equals the product of the norms. Unit quaternions describe 3D rotations without the gimbal lock of Euler angles, and two rotations combine by a single multiplication. Since q and −q give the same rotation, the half-angle θ/2 appears in the formula.

Worked example

Default inputs: q₁ = 1 + 2i + 3j + 4k, q₂ = 5 − 6i + 7j + 8k, operation q₁ × q₂.

  1. w = 5 − (−12) − 21 − 32 = 5 + 12 − 21 − 32 = −36.
  2. x = 1(−6) + 2(5) + 3(8) − 4(7) = 0.
  3. y = 1(7) − 2(8) + 3(5) + 4(−6) = −18.
  4. z = 1(8) + 2(7) − 3(−6) + 4(5) = 60. Result: −36 − 18j + 60k.
  5. Norm of the result = 72.24956747 = |q₁||q₂| = √30 × √174. For q₁: norm 5.477225575, rotation angle 2·acos(1/√30) ≈ 158.9605302°, axis (2, 3, 4)/√29 ≈ (0.371391, 0.557086, 0.742781).

How to read the result

For multiplication, swapping the order usually changes the answer, so make sure the order matches your application (in many graphics libraries, q₂q₁ means "apply q₁, then q₂"). The rotation angle and axis are read from q₁ after normalising it. A norm of 1 means the quaternion is a pure rotation.

Common mistakes

Keep in mind: Software libraries differ in component order and in whether they rotate points or coordinate frames. Check the convention of the library you use before copying numbers.

Frequently asked questions

Why are quaternions used for 3D rotation?

They are compact, avoid gimbal lock and interpolate smoothly between orientations.

What does the conjugate do?

It reverses the imaginary part; for a unit quaternion it is the inverse rotation.

Do q and −q represent the same rotation?

Yes. Both give the same v′ = q v q⁻¹.

Sources: Wolfram MathWorld, "Quaternion" and "Quaternion Rotation"

Checked 9 Nov 2026. Wolfram MathWorld, “Quaternion” (Hamilton’s rules, product components, conjugate, norm √(a₁² + a₂² + a₃² + a₄²), inverse = conjugate ÷ norm²) and “Quaternion Rotation” (q = cos(θ/2) + n̂ sin(θ/2), p′ = q p q⁻¹).

🧮 All math & statistics tools →🌍 Calculators by country →