Starlight Tools

Change of Basis Matrix Calculator

Convert coordinate columns from an ordered basis B to an ordered basis C. The calculator finds both directions, checks the basis matrices, and can transform an optional vector—entirely in your browser.

Enter Two Ordered Bases

Each basis vector is a column. The relative tolerance controls when a numerical pivot is treated as zero. Failure of this numerical check does not establish exact linear dependence: a mathematically invertible but poorly conditioned matrix may fail at the selected tolerance. Lowering the tolerance does not establish the accuracy of the result.

Old basis B (source coordinates)

Paste basis B

New basis C (destination coordinates)

Paste basis C

Optional vector coordinates [v]B

Leave every entry blank to calculate only the change of basis matrices, or fill every entry to convert a vector from B-coordinates to C-coordinates.

Change of Basis Results

Enter two valid ordered bases to calculate the coordinate conversion matrices.
det(B)—
det(C)—
max |C·PC←B − B|—
max |PC←BPB←C − I|—
Optional vector conversion results will appear here.
Numerical checks appear after a successful calculation.

Calculation Steps

Calculate two bases to see the formulas with your matrices.

Change of Basis Formula and Convention

Basis matrices

B = [b₁ … bₙ], C = [c₁ … cₙ]

The ordered basis vectors are columns written in the same ambient coordinate system, usually standard coordinates.

B-coordinates to C-coordinates

[v]ᴄ = C⁻¹B[v]ᴮ

Therefore the displayed forward change of basis matrix is Pᴄ←ᴮ = C⁻¹B.

C-coordinates to B-coordinates

[v]ᴮ = B⁻¹C[v]ᴄ

The reverse matrix is Pᴮ←ᴄ = B⁻¹C, the inverse of the forward matrix.

Convention: Arrows show the direction of coordinate conversion: destination ← source. Some textbooks name a change of basis matrix in the opposite verbal order, so use the displayed formula rather than relying only on a name.
Numerical method: The calculator uses scaled partial pivoting and JavaScript double-precision arithmetic. It accepts zero or finite nonzero entries from 10⁻⁴⁰ through 10⁴⁰ in magnitude. Display precision does not round intermediate values.

How to Use the Calculator

  1. Choose the dimension of the vector space.
  2. Enter the old ordered basis B and new ordered basis C. Put one basis vector in each column, with components down the rows.
  3. Optionally enter all coordinates of a vector relative to B.
  4. Select Calculate change of basis. Read PC←B for the forward conversion and PB←C for the reverse conversion.
  5. Use the residuals to check the floating-point calculation, then copy or download the result if needed.

Worked 2D Example

The default example uses B = [(1,1), (1,−1)], C = [(1,1), (0,2)], and [v]B = (3,−1). The basis vectors are columns, so the matrices written row by row are B = [[1, 1], [1, −1]] and C = [[1, 0], [1, 2]]. The inverse is C⁻¹ = [[1, 0], [−1/2, 1/2]]. Multiplying gives Pᴄ←ᴮ = C⁻¹B = [[1, 0], [−1/2, 1/2]] · [[1, 1], [1, −1]] = [[1, 1], [−1/2 + 1/2, −1/2 − 1/2]] = [[1, 1], [0, −1]]. Thus:

Forward matrix

Pᴄ←ᴮ = [[1, 1], [0, −1]]

This converts the vector to [v]C = (2,1). Here P = Pᴄ←ᴮ satisfies P² = I, so the forward and reverse matrices happen to be identical. In general, the reverse matrix is the inverse of the forward matrix and need not be the same matrix.

Standard-coordinate check

B(3,−1) = (2,4) = C(2,1)

Both coordinate columns describe the same vector in the ambient coordinate system.

Ordered Bases, Invertibility, and Numerical Limits

A coordinate column records the coefficients of a vector relative to an ordered basis. Because order determines which coefficient multiplies which basis vector, swapping two columns changes the conversion matrix. Both entered matrices must be square and nonsingular. If a matrix's columns are linearly dependent, vectors outside their span have no coordinate representation using those columns, while vectors within their span have nonunique representations. This prevents a unique change-of-basis map for the whole ambient space.

The calculator verifies CPC←B ≈ B and that the two conversion matrices multiply to the identity. The displayed max |C·P − B|, where P is the forward conversion matrix, is an absolute, entrywise reconstruction residual: the largest absolute entry of C·P − B. Its magnitude depends on the input scale, so it is not a relative error measure. Small nonzero residuals are normal in floating-point arithmetic. Small reconstruction and mutual-inverse residuals demonstrate numerical consistency but do not guarantee accurate coordinates for poorly conditioned bases. Large condition estimates mean rounding or small input changes may strongly affect the result.

Change of Basis Matrix FAQs

What is a change of basis matrix?

It converts the coordinate column of the same vector between two ordered bases. The columns of PC←B are the vectors of basis B expressed in basis C.

Why is the formula C⁻¹B rather than B⁻¹C?

Starting from v = B[v]B = C[v]C, multiply by C⁻¹ to get [v]C = C⁻¹B[v]B. The order reverses when converting in the other direction.

Does the order of basis vectors matter?

Yes. Coordinates belong to an ordered basis. Reordering columns changes which coefficient belongs to each basis vector.

What if one entered basis is singular?

An exactly singular matrix has linearly dependent columns, so they do not form a basis and unique coordinate conversion over the whole ambient space is impossible. Check for duplicate, zero, or dependent basis vectors. A failed numerical pivot check at the selected tolerance is different from proof of exact singularity: a mathematically invertible but poorly conditioned matrix may also fail that check. Lowering the tolerance may allow the check to pass, but does not establish accurate coordinates.

Are the forward and reverse matrices inverses?

Yes. (C⁻¹B)⁻¹ = B⁻¹C. The mutual-inverse residual checks this numerically.

Can I enter basis vectors as rows?

No. This calculator follows the common column-vector convention: place each basis vector in one column. If your source lists vectors as rows, transpose that arrangement first.

Are my entries private?

Yes. The page calculates locally and does not transmit or store your basis or vector entries. Copying and downloads are also created in your browser.

Calculation Notes

Last reviewed: August 5, 2026 by the Starlight Tools editorial team.

The coordinate-map definition and column-basis convention were checked against MIT OpenCourseWare’s change of basis materials. Numerical output is appropriate for study and routine calculation; use exact or higher-precision software when a proof or precision-sensitive result is required.

Explore more tools