Quaternion Calculator

Quick answer

The quaternion calculator adds, subtracts, multiplies and divides quaternions, finds the inverse, magnitude and conjugate, and builds the unit quaternion and rotation matrix for a rotation about an axis.

Result
−60 + 12i + 30j + 24k
Notes
q₂·q₁ = −60 + 20i + 14j + 32k (quaternion multiplication is not commutative)

Quaternions extend complex numbers to four dimensions. Unit quaternions represent 3D rotations without the gimbal lock of Euler angles, which is why they are used in computer graphics, robotics, spacecraft attitude control and phone motion sensors.

How to use the Quaternion Calculator

  1. I want to find the…
  2. q₁: a (real)
  3. q₁: b (i)
  4. q₁: c (j)
  5. q₁: d (k)
  6. q₂: e (real)
  7. q₂: f (i)
  8. q₂: g (j)
  9. q₂: h (k)
  10. Axis x
  11. Axis y
  12. Axis z
  13. Angle θ
  14. Angle unit

Everything is calculated in your browser, so results appear instantly and nothing you type is sent to a server.

How it works

Products use the Hamilton rules (ij = k, jk = i, ki = j, and the reverse orders give the negatives), so multiplication is not commutative. Division is defined as multiplication by the inverse, giving left and right quotients.

Formula

q = a + bi + cj + dk, i² = j² = k² = ijk = −1 ‖q‖ = √(a² + b² + c² + d²), q⁻¹ = q̄ / ‖q‖² Rotation: q = cos(θ/2) + sin(θ/2)(xi + yj + zk)

Worked example

Inputs: I want to find the…: Product q₁ · q₂; q₁: a (real): 1; q₁: b (i): 2; q₁: c (j): 3; q₁: d (k): 4; q₂: e (real): 5; q₂: f (i): 6; q₂: g (j): 7; q₂: h (k): 8.
Results: Result = −60 + 12i + 30j + 24k; Notes = q₂·q₁ = −60 + 20i + 14j + 32k (quaternion multiplication is not commutative).

Key terms

Quaternion
A number a + bi + cj + dk with three imaginary units.
Gimbal lock
Loss of a degree of freedom with Euler angles.

Frequently asked questions

Why is quaternion multiplication not commutative?

Because ij = k but ji = −k. Rotations in 3D depend on their order.

What is a unit quaternion?

One with magnitude 1; unit quaternions represent rotations.

How do I rotate a vector with a quaternion?

Write the vector as a pure quaternion v and compute q v q⁻¹.

Who invented quaternions?

William Rowan Hamilton in 1843, who carved i² = j² = k² = ijk = −1 into a Dublin bridge.

Sources

  1. Wolfram MathWorld: Quaternion
  2. NASA: Euler angles, quaternions and transformation matrices

Cite this calculator

Speedy Calculator. (2026). Quaternion Calculator. Speedy Calculator. https://speedycalculator.com/calculators/math/quaternion/