Your country

Tools that support it use your country for local currency, number formats, units and paper size. Your choice is saved only in this browser.

Type a name or a two-letter code. Use the up and down arrow keys to move through the countries, Enter to choose one and Escape to close.

Matrix Calculator

Matrices up to 10 × 10 in exact fractions — every step, from determinants to the SVD.

Math No upload Works offline Free, no sign-up

Matrix A

Entries of matrix A

Entries: whole numbers, decimals or fractions such as −3/4 (empty cells count as 0). Paste a block from a spreadsheet into any cell, or switch to Text to type or paste rows — spaces, tabs or commas between entries; [[1, 2], [3, 4]], MATLAB [1 2; 3 4] and LaTeX bmatrix also work.

Result

det(A) —

Step by step

    About A

    Next steps

    About the Matrix Calculator

    Enter one or two matrices of any size up to 10 × 10 and get A + B, A − B, A × B, k·A, the transpose, a power Aⁿ, the trace, the determinant, the inverse, the cofactor matrix and adjugate, the rank with the reduced row echelon form and a null-space basis, or the LU, QR, Cholesky and singular value decompositions — each with its steps. The determinant can be worked by row reduction, cofactor expansion or the rule of Sarrus, and the inverse by Gauss–Jordan elimination or the adjugate.

    Arithmetic is exact: decimals you type become fractions, so the inverse of [[4, 7], [2, 6]] comes out as [[3/5, −7/10], [−1/5, 2/5]] rather than rounded decimals, and QR and Cholesky keep their square roots exact (√2/2, √6/3). Switch to decimals at any time. Paste a block straight from a spreadsheet, or type rows as text — including Python, MATLAB and LaTeX notation — and copy results back out in those formats.

    How to use it

    1. Choose the operation. A + B, A − B and A × B add a second matrix B.
    2. Set the rows and columns, then type the entries — whole numbers, decimals or fractions such as −3/4 (empty cells count as 0). You can paste a block from Excel or Google Sheets into any cell, or switch to Text and paste rows.
    3. Read the result and the steps. For the determinant or the inverse, pick the method you need to show.
    4. Switch between fractions and decimals, copy the result as text, LaTeX, Python, MATLAB or CSV, download the working, or press “Use as A” to carry on with the result.

    Examples

    Determinant
    Input
    [[2, −3, 1], [2, 0, −1], [1, 4, 5]]
    Result
    det = 49

    Expanding along row 2, which has a zero: −2 × (−19) − (−1) × 11 = 38 + 11 = 49.

    Inverse of a 2 × 2
    Input
    [[4, 7], [2, 6]]
    Result
    [[3/5, −7/10], [−1/5, 2/5]]

    det = 4 × 6 − 7 × 2 = 10, and A⁻¹ = (1/10) × [[6, −7], [−2, 4]].

    Product
    Input
    [[1, 2], [3, 4]] × [[5, 6], [7, 8]]
    Result
    [[19, 22], [43, 50]]

    The top-left entry is row 1 times column 1: 1 × 5 + 2 × 7 = 19.

    Rank and null space
    Input
    [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
    Result
    rank 2, null space spanned by (1, −2, 1)

    The reduced row echelon form is [[1, 0, −1], [0, 1, 2], [0, 0, 0]].

    Cholesky
    Input
    [[4, 12, −16], [12, 37, −43], [−16, −43, 98]]
    Result
    L = [[2, 0, 0], [6, 1, 0], [−8, 5, 3]]

    The pivots 4, 1 and 9 are all positive, so the matrix is positive definite and A = LLᵀ.

    Singular values
    Input
    [[3, 2, 2], [2, 3, −2]]
    Result
    σ = 5 and 3

    AAᵀ = [[17, 8], [8, 17]] has eigenvalues 25 and 9.

    Common uses

    • Checking linear algebra homework — determinants, inverses, RREF and rank — with the method your course uses.
    • Getting exact fractional answers instead of rounded decimals for proofs and textbook exercises.
    • Factorising a matrix (LU, QR, Cholesky, SVD) to study numerical methods, least squares or data analysis.
    • Converting a matrix between spreadsheet, LaTeX, Python and MATLAB notation.

    Exact fractions, surds and decimals

    Every rational operation — sums, products, powers, determinants, inverses, cofactors, rank, RREF and LU — is computed in exact fractions with arbitrary-size integers, so there is no rounding at all. The QR factorisation (by Gram–Schmidt) and the Cholesky factorisation (through A = LDLᵀ) are exact too, with each entry written as a fraction times a square root. The singular value decomposition generally involves roots of polynomial equations, so it is computed in floating point (about 15 significant digits) by one-sided Jacobi rotations; QR falls back to Householder reflections in floating point when the columns are dependent. Decimal display rounds the exact values to the places you choose.

    The methods

    • Determinant by row reduction: reduce to a triangular matrix; adding a multiple of a row changes nothing, each row swap flips the sign, and the determinant is the product of the diagonal.
    • Cofactor (Laplace) expansion: det A = Σ (−1)^(i+j) aᵢⱼ Mᵢⱼ along the row or column with the most zeros (shown up to 5 × 5).
    • Inverse: row-reduce [A | I] to [I | A⁻¹] (Gauss–Jordan), or A⁻¹ = adj(A) / det(A), where adj(A) is the transposed cofactor matrix.
    • LU: Gaussian elimination stores its multipliers in L; a row swap needed for a zero pivot is recorded in P, giving PA = LU.
    • QR: Gram–Schmidt makes the columns orthogonal; Q holds them normalised and R = QᵀA.
    • Cholesky: for a symmetric positive-definite A, A = LLᵀ with L lower triangular; it exists exactly when every pivot is positive.
    • SVD: A = UΣVᵀ with orthogonal U and V; the singular values are the square roots of the eigenvalues of AᵀA.

    The algorithms follow Golub and Van Loan, Matrix Computations (4th edition, 2013).

    Typing and pasting matrices

    In the grid, Enter and the arrow keys move between rows, and pasting a copied block of spreadsheet cells fills the grid from that cell (growing it up to 10 × 10). In Text mode, put each row on its own line with spaces, tabs or commas between entries; [[1, 2], [3, 4]] (Python, JSON), [1 2; 3 4] (MATLAB) and LaTeX bmatrix with \frac also work. Write numbers without thousands separators and with a dot for decimals (1000, 2.5): text such as 1,000 2,000 is refused rather than guessed. Empty spreadsheet cells count as 0. Copy the result back as plain text, LaTeX, a Python list, MATLAB or CSV.

    Limitations

    • Matrices up to 10 × 10 with rational entries of up to 40 digits. Irrational numbers such as √2 or π must be typed as decimals.
    • Exact answers can have long fractions; the decimal view makes them easier to read. Exact fractions also grow quickly: a 10 × 10 matrix with very long entries can take several seconds, and some operations (such as QR) can need more than the 30-second limit. The work runs in the background, so the page stays usable, and Stop ends it.
    • The SVD is computed in floating point; singular vectors are only unique up to sign, so another program may show some columns negated.
    • Eigenvalues and eigenvectors of A itself are not computed (the SVD steps show those of AᵀA), and complex entries are not supported.

    Privacy

    Everything happens in your browser. What you enter or open here is not uploaded or stored by MySmartCoPilot.

    Frequently asked questions

    How do I find the inverse of a matrix?

    Choose “Inverse A⁻¹”. With Gauss–Jordan elimination the matrix [A | I] is row-reduced until the left half is the identity; the right half is then A⁻¹. For a 2 × 2 matrix [[a, b], [c, d]] the shortcut is (1/(ad − bc)) × [[d, −b], [−c, a]]. The inverse exists only when the determinant is not 0.

    Why does my matrix have no inverse?

    Its determinant is 0: the matrix is singular, its rows (and columns) are linearly dependent, and its rank is less than its size. For example [[1, 2], [2, 4]] has det = 4 − 4 = 0 because the second row is twice the first. Such a matrix squashes space flat, so the transformation cannot be undone.

    How do I multiply two matrices?

    A × B needs as many columns in A as there are rows in B; an m × n matrix times an n × p matrix gives an m × p matrix. Each entry is a row of A times a column of B, multiplied term by term and added. The order matters: A × B and B × A are usually different, and one may not even exist — use “Swap A and B” to try the other order.

    What does the rank of a matrix tell me?

    The number of linearly independent rows, which always equals the number of independent columns — the number of leading 1s in the reduced row echelon form. A square matrix of full rank is invertible. For a system Ax = b, the number of free variables is the number of columns minus the rank.

    Which decomposition should I use?

    LU (PA = LU) solves many systems with the same A quickly. QR is the stable way to do least-squares fitting. Cholesky (A = LLᵀ) is twice as fast as LU but only for symmetric positive-definite matrices, such as covariance matrices. The SVD reveals the rank, the condition number and the best low-rank approximation of any matrix.

    Can I paste a matrix from Excel or Google Sheets?

    Yes. Copy the cells, click the cell of the grid where the block should start, and paste — the entries fill in and the grid grows as needed. You can also switch to Text and paste there.

    Quick answers and tool search

    Type to search tools or to get a quick answer, for example 18% of 2500. Use the up and down arrow keys to move through the results, Enter to choose, and Escape to close.