Symmetric Matrix Generator
A symmetric matrix equals its own transpose, so the lower triangle is a mirror of the upper and only about half the entries are free to choose. That structure is not a curiosity — covariance matrices, adjacency matrices of undirected graphs and distance matrices are all symmetric, and the property guarantees real eigenvalues, which is what makes them tractable.
What this generator does
Fills the upper triangle at random and mirrors it below the diagonal, then reports the trace, the determinant and how many of the entries were actually free to choose — n(n+1)/2 rather than n squared.
How to use this tool
- Choose the matrix size.
- Read the matrix and check the mirror across the diagonal yourself.
- Compare the free-entry count against the total.
- Copy the matrix if you need it as test data.
Understanding the controls
- Matrix size
- Between 2 and 6. Determinants are computed by cofactor expansion, which stays exact but grows quickly beyond that.
- Seed
- Any word reproduces exactly the same matrix, which is what makes it usable as a fixture.
Common use cases
- Test data for code that expects symmetric input
- Showing how many entries a symmetric matrix really stores
- Covariance and adjacency matrix examples
- Teaching why transposing changes nothing here
- Repeating a symmetric fixture exactly from a seed
How this generator works
The check does the obvious thing and does it literally: it transposes the finished matrix and requires the result to be identical, then recomputes the trace and determinant from the entries rather than trusting the values carried alongside.
Randomness and fairness
The upper-triangle entries are random; the symmetry is a property of the construction and is verified afterwards. Seeded matrices reproduce exactly and are therefore explicitly not cryptographically secure. Without a seed the browser's cryptographically secure generator fills them.
For how randomness is produced across the whole site, see how Generate Random works.
Limitations and good to know
- Entries are small whole numbers, chosen so the determinant stays readable rather than realistic.
- Symmetric does not mean positive definite — most of these are not, which is what the positive definite generator is for.
- Eigenvalues are not computed here, though symmetry guarantees they are real.
- Sizes stop at six because cofactor expansion grows factorially.
- A matrix disappears on leaving; seed it if it is being used as a fixture.
Privacy and your data
The matrix is generated in your browser. Nothing about it or your seed is transmitted or kept.
Related generators
- Positive Definite Matrix GeneratorMatrices built to be positive definite and proved so twice — by Cholesky decomposition and by Sylvester's criterion.
- Random Matrix GeneratorA random 3x3 grid of numbers, for maths practice or placeholder data.
- Matrix Question GeneratorMultiplication, determinant and inverse questions, with inverses built to have whole-number entries.
- Sparse Matrix GeneratorMatrices with most cells zero, in both dense and compressed-sparse-row form, with the storage comparison stated honestly in both directions.