{
    "name": "Matrix Calculator",
    "url": "https://calculators.geekmidst.com/calculators/matrix-calculator",
    "markdown": "https://calculators.geekmidst.com/calculators/matrix-calculator.md",
    "category": "Algebra, geometry & advanced math",
    "description": "Find the determinant, inverse, rank, trace or transpose of a matrix, or add, subtract and multiply two matrices, with exact fractions.",
    "summary": "Type each matrix row on its own line. Arithmetic is done in exact fractions, so an inverse comes out as 13/9 rather than 1.444444.",
    "also_called": [
        "Determinant calculator",
        "Inverse matrix calculator",
        "Matrix multiplication calculator"
    ],
    "applies_to": "Worldwide",
    "last_updated": "2026-10-29",
    "computation": "Results are computed in the visitor’s browser on the HTML page. This API describes the calculator; it does not compute results.",
    "inputs": [
        {
            "name": "op",
            "label": "Operation",
            "type": "select",
            "default": "inverse",
            "options": {
                "det": "Determinant of A",
                "inverse": "Inverse of A",
                "rank": "Rank of A",
                "trace": "Trace of A",
                "transpose": "Transpose of A",
                "add": "A + B",
                "sub": "A − B",
                "mul": "A × B"
            }
        },
        {
            "name": "a",
            "label": "Matrix A",
            "type": "textarea",
            "default": "2 1\n7 4"
        },
        {
            "name": "b",
            "label": "Matrix B",
            "type": "textarea",
            "default": "1 0\n0 1"
        }
    ],
    "outputs": [
        {
            "key": "result",
            "label": "Result (exact)",
            "format": "text"
        },
        {
            "key": "decimal",
            "label": "Result (decimal)",
            "format": "text"
        },
        {
            "key": "size",
            "label": "Size of the result",
            "format": "text"
        }
    ],
    "formula": {
        "text": "det and rank by Gaussian elimination;  A⁻¹ by Gauss–Jordan elimination on [A | I];  (AB)ᵢⱼ = Σₖ Aᵢₖ Bₖⱼ",
        "variables": {
            "A, B": "the matrices",
            "I": "the identity matrix",
            "i, j": "row and column positions"
        }
    },
    "worked_example": {
        "inputs": {
            "op": "inverse",
            "a": "2 1\n7 4",
            "b": "1 0\n0 1"
        },
        "steps": [
            "det A = 2 × 4 − 1 × 7 = 1.",
            "For a 2 × 2 matrix, swap the diagonal, negate the off-diagonal and divide by det: [4, −1; −7, 2] ÷ 1.",
            "Check: [2 1; 7 4] × [4 −1; −7 2] = [1 0; 0 1]."
        ],
        "result": "The inverse of [2 1; 7 4] is [4 −1; −7 2]."
    },
    "interpretation": "A matrix has an inverse only when its determinant is not zero. The rank is the number of independent rows; a square matrix of full rank is invertible. Results are written row by row, with rows separated by semicolons.",
    "assumptions": [
        "Entries are real numbers entered as decimals or fractions."
    ],
    "limitations": [
        "Up to 10 × 10. Eigenvalues and decompositions are not covered."
    ],
    "rules": null,
    "faqs": [
        {
            "question": "When can I multiply two matrices?",
            "answer": "A × B needs the number of columns of A to equal the number of rows of B. An m × n matrix times an n × p matrix gives an m × p matrix, and in general A × B ≠ B × A."
        },
        {
            "question": "Why does it say the matrix is singular?",
            "answer": "Its determinant is zero: some row is a combination of the others, so the matrix squashes space flat and cannot be undone."
        }
    ],
    "sources": [],
    "related": [
        {
            "name": "Fraction Calculator",
            "url": "https://calculators.geekmidst.com/calculators/fraction-calculator"
        },
        {
            "name": "Big Number Calculator",
            "url": "https://calculators.geekmidst.com/calculators/big-number-calculator"
        },
        {
            "name": "Distance Calculator",
            "url": "https://calculators.geekmidst.com/calculators/distance-calculator"
        }
    ],
    "disclaimer": null,
    "publisher": "GM¹X CalcVerse"
}