Quaternion Multiplication Calculator

Enter the components of both quaternions to compute their Hamilton product.

How it is calculated

Each quaternion is entered as four numbers (w, x, y, z), meaning w + xi + yj + zk. The first is p = (w1, x1, y1, z1) and the second is q = (w2, x2, y2, z2). The tool returns the Hamilton product p × q:

w = w1w2 − x1x2 − y1y2 − z1z2, x = w1x2 + x1w2 + y1z2 − z1y2, y = w1y2 − x1z2 + y1w2 + z1x2, z = w1z2 + x1y2 − y1x2 + z1w2. It also reports the magnitude √(w² + x² + y² + z²) and the scalar part w. All eight fields are required. Order matters: p × q is generally not q × p. Values are shown with four decimals.

Worked example

Multiply p = (1, 2, 3, 4) by q = (5, 6, 7, 8). Scalar part: 1×5 − 2×6 − 3×7 − 4×8 = 5 − 12 − 21 − 32 = −60. x part: 1×6 + 2×5 + 3×8 − 4×7 = 6 + 10 + 24 − 28 = 12. y part: 1×7 − 2×8 + 3×5 + 4×6 = 7 − 16 + 15 + 24 = 30. z part: 1×8 + 2×7 − 3×6 + 4×5 = 8 + 14 − 18 + 20 = 24. The tool shows (-60.0000, 12.0000, 30.0000, 24.0000). Magnitude: √(3600 + 144 + 900 + 576) = √5220 = 72.2496. The scalar part is −60.

Try this example →

Common mistakes

  • Assuming the order does not matter. Swapping the two quaternions here gives (−60, 20, 14, 32) instead, because multiplication of quaternions is not commutative.
  • Typing the components in the order (x, y, z, w). The first field of each quaternion is the scalar part w, then x, y and z.
  • Multiplying component by component. A quaternion product mixes all the terms using the i, j, k rules; it is not (w1w2, x1x2, ...).
  • Expecting a rotation to stay a rotation without unit length. Only quaternions of magnitude 1 describe pure rotations; the product's magnitude is the product of the two magnitudes, so normalise first when composing rotations.
  • Leaving a field empty to mean zero. All eight values are required, so enter 0 explicitly.

About this calculator

Quaternions extend complex numbers with three imaginary units (i, j, k) instead of one, and are written as q = w + xi + yj + zk. Multiplying two quaternions uses the Hamilton product, a non-commutative operation (qp ≠ pq in general) defined by the rules i² = j² = k² = ijk = −1, which combines the scalar and vector parts of both quaternions into a new quaternion.

This calculator takes the four components of two quaternions, computes their Hamilton product, and reports the resulting quaternion along with its magnitude and scalar part. Quaternions are the standard way to represent 3D rotations in computer graphics, robotics, flight simulation, and game engines because, unlike Euler angles, they avoid gimbal lock and compose smoothly through multiplication.

Was this helpful?

You can pick up to 3 reactions.

Comments (1)

  • Editorial team

    Order matters here. Multiplying (1, 2, 3, 4) by (5, 6, 7, 8) gives (-60, 12, 30, 24), while the reverse order gives (-60, 20, 14, 32), although both have the same magnitude of 72.2496. The tool takes the scalar first and uses the Hamilton convention, so libraries that store the scalar last need their inputs reordered. Which component order does your library use?

Popular calculators

All Calculators