Goal
Sum the three main-diagonal entries of a finite row-major 3x3 matrix.
Worldwide context
Saved once here, used across the site.
Currency changes display only. Country selection guides tax input; no tax rate is guessed.
Sum the three main-diagonal entries of a finite row-major 3x3 matrix.
tr(A) = a11 + a22 + a33.A clearer path to an answer
This page keeps the calculation transparent: define the goal, enter the matching values, inspect the method, and decide what the result means in your situation.
Sum the three main-diagonal entries of a finite row-major 3x3 matrix.
A11 · A12 · A13 · A21 · A22 · A23 · A31 · A32 · A33
tr(A) = a11 + a22 + a33.
Calculate, review the assumptions below, then compare a related tool when the decision needs more context.
Sum the three main-diagonal entries of a finite row-major 3x3 matrix.
Open the Matrix Trace pageMore math tools
Download PDFDownload Word (.doc)
Enter your values above and choose Calculate to see the result here.
Calculation map
tr(A) = a11 + a22 + a33.
Bounded, transparent calculation
Your recent runs stay in this browser session only.
Formula: tr(A) = a11 + a22 + a33.
The trace is the scalar sum of the main diagonal of a square matrix. For this fixed 3x3 contract, only a11, a22, and a33 contribute to the numeric result.
Worked example: tr(A) = 1 + 1 + 0 = 2.
The displayed limits are checked before the handler runs. Model-specific domain checks may also reject impossible or non-finite inputs.
Methodology: This calculator follows the WorldCalculate input, formula, precision, and boundary policy. Read the official methodology.
Calculator usage statistics
This section counts anonymous successful Calculate submissions, not unique visitors. Counts and top tools appear only when trusted aggregate data is available; country analysis is shown only under the same condition and reporting threshold.
Answer-first guide
Sum the three main-diagonal entries of a finite row-major 3x3 matrix. Start with one clearly defined goal, enter values in the units shown, and keep the result attached to the assumptions below.
This tool is useful when your question includes matrix trace, trace of 3x3 matrix, main diagonal sum. It returns the outputs declared in the calculator contract rather than a live quote, approval, diagnosis, or professional sign-off.
A11 · A12 · A13 · A21 · A22 · A23 · A31 · A32 · A33. Keep the same time period, unit system, and currency wherever the form requires comparable values.
Run the worked example first, compare its output with the page's example, then change one input at a time. This makes an unexpected result easier to trace to a unit, boundary, or assumption.
Need a wider view? Browse Math Calculators or compare the related tools below. The WorldCalculate methodology explains how formulas, examples, limits, and revisions are reviewed.
tr(A) = a11 + a22 + a33.
The trace is the scalar sum of the main diagonal of a square matrix. For this fixed 3x3 contract, only a11, a22, and a33 contribute to the numeric result.
tr(A) = 1 + 1 + 0 = 2.
Context and background
Math calculators move from named quantities to a relation, then to a result that can be checked with substitution, units, or an alternate form.
Arithmetic, algebra, geometry, trigonometry, and number theory provide reusable structures for classroom work and everyday reasoning. Each page narrows that structure to one declared problem.
Research and review
Researched by Hassan ALRowaie, Founder and editorial researcher at WorldCalculate.
This guide follows the live calculator's declared inputs, formula, worked example, assumptions, validation boundaries, and source-backed methodology. The review date describes editorial review of the calculator explanation; it is not a promise that external facts or rates remain current.
The trace compresses a square matrix to one scalar by adding the entries on its main diagonal. This calculator fixes the input at a finite 3x3 matrix with row-major keys a11 through a33 and returns the numeric value a11+a22+a33. Off-diagonal entries are still validated because they belong to the declared matrix input, but they do not contribute to this metric. The page does not calculate a determinant, norm, rank, or eigenvalue list. The guide explains the diagonal contract, field order, formula, worked example, signs and cancellation, bounds and finite output, structural identities, distinctions from related metrics, and the careful interpretation of one scalar summary.
For a square matrix A, the trace is written tr(A) and is the sum of entries whose row and column indices are equal. In a 3x3 matrix those positions are 11, 22, and 33. The result is one scalar rather than another matrix. This makes the trace a compact summary of one structural feature of A, not a complete description of all nine values. Two matrices can have the same trace while differing in every off-diagonal position or in the balance among their diagonal entries.
The main diagonal runs from the upper-left corner to the lower-right corner. It is not the first row, first column, or a list selected by magnitude. The calculator follows the index rule exactly: a11, a22, and a33 are added in that order. The remaining six entries are validated but ignored by the arithmetic. This explicit distinction is useful when a matrix is copied from a table and a visually adjacent off-diagonal value could otherwise be mistaken for a diagonal term.
The fields are ordered row-major: a11, a12, a13, a21, a22, a23, a31, a32, a33. Reconstruct the input as [[a11, a12, a13], [a21, a22, a23], [a31, a32, a33]] before identifying the diagonal. This is especially important because a11 is at the start of the first row, a22 is in the middle of the second row, and a33 is at the end of the third row. The diagonal is a positional concept, not a sequence of the first three entered values.
Every field accepts a finite value from -1000 through 1000 inclusive. It might seem unnecessary to validate off-diagonal values because they do not enter the sum, but accepting an incomplete or invalid matrix would break the declared 3x3 contract and make later reuse ambiguous. The direct handler therefore rejects strings, missing values, NaN, infinity, and out-of-range entries consistently across all nine keys.
The formula is tr(A) = a11 + a22 + a33. The engine reads those three validated entries, adds them with finite checks, normalizes negative zero, and returns a number with a numeric renderer format. It does not inspect the six off-diagonal entries when forming the result. The calculation steps display the three source terms so a reviewer can see exactly which positions were selected and reproduce the sum by hand.
Trace is linear with respect to addition and scalar multiplication: tr(A+B) = tr(A)+tr(B), and tr(sA) = s tr(A). Those relationships are useful when this tool is used alongside the matrix addition and matrix-by-scalar tools. They do not change the field contract or make the trace a substitute for a matrix result. If a later operation needs off-diagonal structure, retain the original matrix rather than keeping only its trace.
For A = [[1, 2, 3], [0, 1, 4], [5, 6, 0]], the main diagonal is 1, 1, and 0. The trace is 1+1+0 = 2. The entries 2, 3, 0, 4, 5, and 6 are visible parts of the matrix but are not included in the trace. A hand check can circle the upper-left, center, and lower-right cells before adding them. This simple visual habit prevents the common error of summing an entire row or the first three values in row-major input order.
Change the diagonal to -2, 4, and 7 while keeping the off-diagonal entries unchanged, and the trace becomes -2+4+7 = 9. Change the off-diagonal entries only, and the trace remains 2. These paired examples demonstrate both sensitivity and insensitivity: diagonal changes affect the metric, while off-diagonal changes do not. The result therefore depends on structure as well as numbers.
Negative diagonal entries are valid and retain their signs. A diagonal of [-3, 1, 2] gives a trace of 0 by cancellation, not because the matrix is a zero matrix. A zero on the diagonal contributes nothing, while zeros off the diagonal have no effect at all on the result. The handler does not apply an absolute value because the signed sum is the definition. A negative trace is also a valid result when the negative diagonal contribution dominates.
The trace can be exactly zero for many nonzero matrices. For example, a diagonal matrix with entries [4, -4, 0] has trace zero but still has nonzero diagonal structure. This is a useful reminder not to interpret a scalar zero as proof that the entire matrix vanishes. It also provides a negative-zero test: exact cancellation is normalized to ordinary numeric 0 so the renderer does not expose a sign artifact.
The visible entry bounds are inclusive, even for the six positions that do not affect the current sum. With the declared range, the trace remains a small finite number, but the engine still checks the derived addition. This protects the output contract if the helper is reused or the input policy changes. Numeric result entries include a label, number format, unit string, and precision so the shared renderer can display the scalar without parsing text.
Unlike matrix addition, transpose, or inverse, trace is a scalar metric and therefore returns a numeric result rather than a text matrix. The steps and note remain text and are nonempty. JSON serialization is deterministic because the output contains finite numbers and ordinary strings only. A later consumer should store the matrix inputs with the trace, since the scalar alone cannot reconstruct which diagonal values or off-diagonal structure produced it.
The trace differs from the determinant. The determinant uses all entries and describes a multiplicative scalar property, while the trace is a direct diagonal sum. It differs from the Frobenius norm, which uses all nine squared magnitudes and cannot be negative. It differs from rank, which counts independent directions under a tolerance. It also differs from a matrix power, which returns a matrix. Similar labels such as matrix summary should not hide these different input dependencies and output types.
For a triangular matrix, the determinant is the product of diagonal entries and the trace is their sum. That relationship can be useful in a structured exercise, but neither metric alone describes the entire matrix. Transposition preserves the trace because the diagonal positions remain fixed. Similarity transformations also preserve trace in suitable algebraic settings, but the calculator does not perform or validate such transformations.
To verify a trace, draw a diagonal through the 3x3 input and add only the three crossed cells. Change one diagonal entry by a known amount and confirm that the trace changes by the same amount. Change an off-diagonal entry and confirm that the result is unchanged. Use a signed cancellation example and an all-zero matrix to test zero behavior. These checks directly exercise the indexing rule rather than relying on a generic scalar fixture.
A trace can be a useful intermediate in linear algebra, statistics, control, or software validation, but this page does not determine what it means in a particular application. It does not infer eigenvalues, stability, a covariance interpretation, or a physical conserved quantity. Enter only the nine values needed by the formula and keep units, uncertainty, model choice, and consequential decisions with the surrounding analysis. A finite trace is a transparent sum, not a complete matrix diagnosis.
The diagonal should be selected by indices, not by visual prominence or by the order in which a source table lists values. In a row-major object, a11 is first, a22 is fifth, and a33 is ninth. A data import that flattens a matrix can make the diagonal appear consecutive only after a separate stride calculation. Map the named fields first and then apply the formula. This small discipline prevents an apparently reasonable sum from using the first row instead of the main diagonal.
Trace changes linearly when a diagonal entry changes, which makes it useful for incremental checks. If a correction matrix has a known diagonal, the trace of the corrected matrix should equal the original trace plus the correction trace. This does not mean that the full corrected matrices are interchangeable. Off-diagonal corrections may alter products, rank, and inverse behavior while leaving the trace unchanged, so retain the full correction object in any audit.
Cancellation should be inspected rather than hidden. A diagonal of 1000, -999.999999999, and a small negative residual can produce a trace close to zero while the individual terms are large. The handler returns the finite floating-point sum and does not decide that close-to-zero means exact zero. If a report rounds the value, show the rule and keep the unrounded number for a reviewer who needs to distinguish cancellation from a genuinely zero diagonal sum.
The scalar trace can be compared across matrices only when the matrices use a compatible scale and basis. A trace from a normalized matrix is not directly comparable with a trace from an unnormalized matrix merely because both are numbers. If rows and columns were reordered, determine whether the operation was a simultaneous permutation or a one-sided layout change before comparing results. The calculator does not store that history, so the caller must preserve it.
A complete trace test suite should include the default matrix, all-zero and all-constant diagonal cases, positive and negative cancellation, an off-diagonal-only perturbation, a transpose, and a scaled matrix. Check the expected linear changes and inspect the numeric result for finiteness and ordinary zero. Store the full named matrix with the trace and formula. That record keeps the scalar reproducible and prevents it from being mistaken for a complete spectral or structural description.
The trace is especially easy to confuse with a row sum because the first three fields in a row-major form are all in row one. A reliable interface should keep the labels visible and a reliable manual check should draw the diagonal through the grid. If an imported flat array is used, calculate the diagonal offsets deliberately rather than assuming that the diagonal values are adjacent in storage.
A matrix with the same trace can have a different determinant, norm, rank, and inverse. For example, changing off-diagonal entries can alter all of those other properties while leaving a11, a22, and a33 fixed. This is not a limitation of trace; it is the reason the metric has a narrow definition. Preserve the full matrix whenever a later question depends on more than the diagonal sum.
If the diagonal entries are measured at different times or under different units, their sum may not represent one coherent scalar even though the handler can add them. Align the observation period and confirm unit compatibility before calculation. The page does not store timestamps, units, or uncertainty, so a report that quotes only the trace would omit information needed to judge whether the sum is meaningful.
For a stable comparison, decide whether to compare raw traces, traces after a common scaling, or traces of normalized matrices. A similarity or basis transformation may preserve trace under exact conditions, but a one-sided row or column rescaling can change it. The handler should not normalize because that would answer a different question. Keep any preprocessing visible and reproducible outside the call.
The final acceptance question is whether the three equal-index entries were selected from the supplied 3x3 grid, added once, and returned as a finite numeric scalar without changing other fields. If yes, the trace contract is complete. Interpretation as a spectral, physical, statistical, or operational quantity needs the matrix context, units, and a separate review rather than an inference from the label trace.
When a trace is used in a batch, keep a row for every source matrix rather than retaining only the scalar column. Include a stable matrix label, the three selected diagonal values, the complete input hash or record reference, and the calculation date when that context matters. This makes a repeated scalar auditable and avoids confusing two matrices that happen to share the same trace.
If two records produce the same trace, compare their diagonal triples before treating the equality as meaningful. Equal sums can result from different positive and negative combinations, and identical diagonals can coexist with very different off-diagonal structure. Retaining that structure is necessary if the next step may calculate a determinant, norm, rank, cofactor, inverse, or product.
The trace is tied to a square matrix and its diagonal positions, but it is more than a visual corner-to-corner sum in many algebraic settings. When a matrix is represented in another compatible basis through a similarity transformation, the trace remains the same in exact mathematics. That invariant explains why trace appears in theoretical work. This calculator does not perform a basis change or verify that two matrices are related by one; it only evaluates the nine entered values under the displayed row-major convention.
A transpose also preserves the trace because transposition leaves a11, a22, and a33 in place. Adding a scalar multiple of the identity changes the trace by three times that scalar for a 3x3 matrix. These relationships can support independent tests, but they should not be used to infer unentered structure. The output is still only the diagonal sum of the specific matrix supplied to the handler.
If a11 changes by delta while the other entries stay fixed, the trace changes by exactly delta. The same is true for a22 and a33. Changing several diagonal entries adds their changes, including their signs. This direct sensitivity makes the trace easy to audit and can be useful when a matrix is updated incrementally. It does not mean that the trace measures the size of the update; a large off-diagonal update can leave it unchanged.
The six off-diagonal fields are intentionally part of the input even though they do not affect the current scalar. They preserve the complete 3x3 matrix contract and allow a caller to keep one consistent input object across related tools. A caller should not conclude that those values are unimportant in a larger workflow. They affect products, determinants, cofactors, inverses, norms, and rank even when the trace ignores them.
The trace adds three finite values and returns the numeric sum before display formatting. For ordinary decimal inputs, floating-point representation can make a mathematically exact cancellation appear as a tiny residual. The handler normalizes only negative zero; it does not apply an arbitrary near-zero threshold because that would change the scalar contract. If a practical application treats small values as zero, state that rule outside the calculator and retain the unrounded result for review.
A scalar trace may have units inherited from a matrix whose diagonal entries are dimensionally comparable. If diagonal entries represent unlike quantities, the sum can be numerically computable but conceptually invalid. The page has no unit selector and cannot assess that issue. A responsible record should state the matrix basis, entry units, time or scenario, and any transformation that occurred before the nine values were entered.
A trace record should preserve the three diagonal values explicitly as well as the full input matrix. Include the formula, the row-major key order, and the displayed result. For a compact review suite, use the default matrix, an all-zero matrix, a signed cancellation diagonal, a diagonal matrix with distinct values, and a matrix whose off-diagonal entries change while its diagonal remains fixed. These cases confirm both dependence and independence claims.
The handler output is JSON serializable and contains a finite numeric result, nonempty calculation steps, and a note that keeps the metric narrow. Downstream code should not reverse-engineer matrix entries from the trace or use the scalar as a replacement for a rank, determinant, norm, or inverse. When a trace is quoted in a report, include the source matrix or a stable identifier for it so the scalar can be reproduced and its context is not lost.
Sum the three main-diagonal entries of a finite row-major 3x3 matrix.
tr(A) = a11 + a22 + a33. The trace is the scalar sum of the main diagonal of a square matrix. For this fixed 3x3 contract, only a11, a22, and a33 contribute to the numeric result.
Enter A11, A12, A13, A21, A22, A23, A31, A32, A33, then choose Calculate.
A is a finite real 3x3 matrix in fixed row-major order. All nine entries are bounded from -1000 through 1000 inclusive, even though off-diagonal entries do not affect the trace. The result is a scalar arithmetic metric and does not infer eigenvalues, units, or a physical interpretation.
This calculator is part of the WorldCalculate library. Its formula, example, assumptions, input bounds, and output formatting follow the official methodology.
These WorldCalculate collections connect this tool with related questions while keeping each calculation separate and transparent.