ForHosting KIT · Math

Symmetric matrix checker

Find out at once whether a square matrix is symmetric: the 3×3 matrix with rows 1 2 3, 2 4 5 and 3 5 6 passes after 3 pairs are compared, and a failing one shows its first mismatch. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon

Runs in your browser. Free, unlimited — your data never leaves this page.

A square matrix is symmetric when it equals its own transpose: every entry above the main diagonal mirrors the entry below it. Students meet the definition while studying quadratic forms, orthogonal diagonalization, and covariance matrices; engineers need the same check before feeding a matrix into a Cholesky factorizer or a spectral routine that assumes symmetry. When the matrix fails, the response names the first violating pair with both values so you can fix the data without recomputing the full transpose yourself.

What symmetry means in a matrix

A square matrix is symmetric when it equals its transpose, the matrix you get by swapping rows and columns. Put simply, the entry in row i, column j must equal the entry in row j, column i. The main diagonal always matches itself, so the check only compares each entry above the diagonal with its mirror below. In a 3×3 matrix that makes 3 comparisons; for the rows 1 2 3, 2 4 5 and 3 5 6 every pair agrees, so the matrix is symmetric. Tiny rounding differences are tolerated, so a matrix that is symmetric apart from floating-point dust still passes.

When to use it and the usual mistakes

Students check homework before attempting orthogonal diagonalization or classifying a quadratic form by hand, and engineers confirm that a covariance matrix or a Hessian is symmetric before a Cholesky factorization or an eigenvalue routine that assumes it. A frequent mistake is to enter a rectangular table or rows of unequal length: those are rejected as a shape problem rather than reported as not symmetric, so you can tell a wrong shape from a real asymmetry. Another is to hunt for the error by recomputing the full transpose; the first mismatched pair, with both values, points straight to the cell to fix.

When a symmetry check is worth running

Classrooms and tutoring platforms use a symmetric matrix checker so learners can verify homework matrices before they attempt diagonalization or quadratic-form classification by hand. Exam-prep generators need a deterministic oracle that fails non-square input instead of quietly returning false, so graders can distinguish a shape error from a true asymmetry. Failed validation does not consume balance.

Prefer this tool when the question is purely structural; for transpose, determinant, inverse, rank, or products, use the matching matrix capability in the catalogue.

Homework and tutoring verification

Students and graders confirm whether a submitted n×n matrix is symmetric, with a clear first-mismatch pair when it is not, without a local CAS install.

Pre-check before Cholesky or eigensolvers

Pipelines that assume a covariance or Hessian is symmetric call this oracle first and surface the violating entries before a deeper factorization fails.

LMS and exam auto-grading

Mark symmetry questions with a deterministic verdict that rejects non-square input as invalid rather than as a false asymmetry.

How do I check if a matrix is symmetric?

Send a square nested array in the matrix field.

Does the matrix need to be square?

Yes. Symmetry is defined for square matrices only.

How are floating-point entries compared?

Entries are treated as equal when they match within a small absolute or relative epsilon, so tiny round-off dust does not falsely mark a nearly symmetric matrix as asymmetric.

What does the first mismatch tell me?

It names the first pair of positions where the entry above the diagonal differs from its mirror below, together with both values. You can correct that cell in your data without working out the whole transpose by hand.

What is the largest matrix I can check?

Up to 32 rows by 32 columns, as long as every entry is a finite number. Within that limit each entry above the diagonal is compared with its mirror; a 3×3 matrix needs 3 comparisons.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/algebra/matrix-symmetric-check

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/algebra/matrix-symmetric-check \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"matrix":[[1,2,3],[2,4,5],[3,5,6]]}'
{
  "matrix": [
    [
      1,
      2,
      3
    ],
    [
      2,
      4,
      5
    ],
    [
      3,
      5,
      6
    ]
  ]
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "algebra.matrix_symmetric_check",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

This symmetric matrix checker accepts one real n-by-n array, compares each upper-triangle entry a_ij with its counterpart a_ji, and returns a clear true or false verdict. Non-square shapes, jagged rows, empty inputs, and non-numeric cells are rejected with invalid_input instead of a silent false.

What symmetry means and how the checker decides

Write a real square matrix A with n rows and n columns. Its transpose A transpose is the matrix obtained by swapping rows and columns so that the entry in position j,i of the transpose equals the entry in position i,j of A. If every such pair agrees, the matrix is symmetric; the first mismatch proves it is not. Understanding the definition pays off later: real symmetric matrices have real eigenvalues, admit orthogonal diagonalization, and underpin positive-definite models in statistics and mechanics. By definition A is symmetric exactly when A equals A transpose, which is equivalent to the family of scalar identities a_ij equals a_ji for every pair of indices i and j. The main diagonal always matches itself, so a practical algorithm only needs to inspect the strictly upper triangle: for each pair with i less than j, compare a_ij against a_ji. This endpoint implements that textbook test with a stable floating-point tolerance so tiny round-off dust does not false-fail classroom or engineering inputs that are symmetric up to machine epsilon. Indices in the violation report are zero-based to match JSON array indexing used by the matrix field. The checker does not compute eigenvalues or factors; it only answers the boolean question and, when needed, points at the first counterexample pair so you can correct a typo before a heavier routine fails deeper in the stack.

Input contract, response fields, and error behaviour

Missing fields, empty matrices, NaN or Infinity cells, and non-numeric strings are likewise rejected and are not billed. Near-zero float dust is cleaned so goldens and demos stay stable while ordinary reals keep double precision. POST a JSON body with the required field matrix: a non-empty nested array of rows forming an n-by-n grid of finite numbers, with n at most thirty-two. You may also pass aliases a, A, input, or m, and you may send the matrix as a JSON string of the same nested structure when a form only accepts text. Every row must have exactly n entries; unequal lengths and non-square shapes fail with invalid_input and a message that states the expected column count. On success the body includes n, the cleaned matrix, is_symmetric as a boolean, pairs_checked as the number of off-diagonal pairs examined, and a short formula string restating A equals A transpose. When is_symmetric is false, first_violation appears with row, col, entry, and transpose_entry for the earliest mismatch in row-major order over i less than j; when the matrix is symmetric that object is omitted entirely rather than set to null. Example: the matrix with rows one two and two one is symmetric; changing the lower-left entry to three yields is_symmetric false with first_violation at row zero column one showing entry two against transpose_entry three. Pair the response with your own display of the grid if you want to highlight the mismatched cells in a UI; this endpoint solves the decision problem only and does not emit plots or step-by-step prose beyond the formula field.

Where a symmetric matrix API earns its keep

Data-science and finance notebooks often build covariance-style arrays by construction and still want a gate before Cholesky or spectral routines that assume symmetry; calling a tiny parse API avoids pulling a full computer-algebra system for a single structural test. Keep matrices within ordinary floating-range magnitudes, pin is_symmetric and first_violation in tests, and you get reproducible verdicts for LMS plugins, edge workers, and continuous-integration checks without standing up symbolic math infrastructure of your own.

What is first_violation?

When the matrix is not symmetric, first_violation names the earliest pair (row, col) with i < j where a_ij differs from a_ji, plus entry and transpose_entry. The field is omitted entirely when the matrix is symmetric.

What does the symmetric matrix checker cost?

The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.

Read the full KIT documentation →