ForHosting KIT · Math

Row echelon form calculator

Enter rows 1, 2, 1; 2, 1, −1; −1, 1, 2 and get a staircase with two pivots and a final row of zeros, so the rank is 2. Entries above the pivots are left as they are. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Precision
6
You get
Rank
2
Rows
3
Columns
3

This row echelon form calculator applies forward Gaussian elimination to any supported rectangular matrix of finite real numbers. It returns the resulting upper staircase matrix, every pivot position, and the rank implied by those pivots. Unlike a reduced row echelon form calculator, it stops after clearing entries below each pivot: it does not clear above pivots or force every pivot to one.

What row echelon form shows

Row echelon form, often abbreviated REF, arranges the nonzero rows of a matrix into a staircase. The leading nonzero entry in each successive row appears farther to the right, every entry below a leading entry is zero, and any completely zero rows fall at the bottom. Those leading entries are pivots.

Their positions reveal the structurally important columns, and their count is the matrix rank. This calculator reports each pivot as an object with zero-based row and column indices, so a pivot at the upper-left corner appears as row zero, column zero. It also returns the row and column counts, precision, method name, and rank.

The resulting matrix is commonly called upper triangular when the input is square and has a pivot in every row, although REF also applies to rectangular and rank-deficient matrices. Elementary row operations preserve the solution set of an augmented linear system and preserve rank, making the output useful for analyzing dependencies without changing the underlying linear relationships. The result is not necessarily unique because different valid row swaps or pivot scaling choices can produce different echelon matrices.

How forward Gaussian elimination works

The algorithm begins at the first row and first column, then searches downward in the active column for the entry with the largest absolute value. If every candidate is effectively zero, that column has no pivot and the search moves right. Otherwise, the selected row swaps into the active position.

The chosen entry becomes the pivot, and a multiple of the pivot row is subtracted from every row beneath it to make the entries below that pivot zero. The active row then advances, and the same process continues in later columns until there are no rows or columns left. Selecting the largest available magnitude is partial pivoting; it reduces avoidable floating-point error compared with always accepting the first nonzero candidate.

Values within the fixed numerical tolerance are cleaned to exact zero, and response entries are rounded to the requested number of decimal places. Precision controls presentation rather than changing which forward operations run. The calculator deliberately stops at this point.

It does not perform backward elimination, clear entries above pivots, or divide every pivot row to create leading ones. Those additional steps belong to Gauss-Jordan elimination and reduced row echelon form. Stopping after the forward phase is exactly what many courses require before back substitution, determinant reasoning, or a separate discussion of RREF.

Preparing input and interpreting output

A square coefficient matrix, a wide augmented matrix, and a tall data matrix are all acceptable within the fifty-row and fifty-column limits. Optional precision is an integer from zero through twelve and defaults to ten. Use more displayed decimals when comparing a floating-point derivation, or fewer when preparing a compact classroom answer.

Rank equals the length of that list. A missing pivot in a column indicates a free column at that stage; fewer pivots than the smaller matrix dimension means the matrix is rank deficient. Do not compare its REF entry-for-entry with a source that normalizes each pivot: both matrices may be valid row echelon forms.

Instead, check the staircase conditions, zeros below pivots, pivot columns, and rank.

Check Gaussian elimination homework

Compare a hand-derived forward-elimination matrix, its staircase pattern, pivot locations, and rank before starting back substitution.

Inspect linear independence

Count pivots after forward elimination to identify rank and reveal dependent rows or columns in a small numeric matrix.

Is row echelon form the same as reduced row echelon form?

No. REF clears entries below pivots. RREF also clears above pivots and makes every pivot equal to one.

Are pivot positions zero-based?

Yes. The first matrix entry is at row 0, col 0, matching normal array indexing in JavaScript and many APIs.

Does the matrix need to be square?

No. Rectangular matrices are supported as long as all rows have the same positive number of columns and remain within the limits.

Why can my answer differ from another valid REF?

REF is not unique. Row swaps and pivot scaling can change its entries. This calculator uses partial pivoting and leaves pivot rows unnormalized for reproducibility.

What do the pivots tell me?

Each pivot marks a column that carries independent information, and their count is the rank. In the example with rows 1, 2, 1; 2, 1, −1; −1, 1, 2, there are two pivots and a zero row, so the rank is 2.

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-row-echelon

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-row-echelon \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"matrix":[[1,2,1],[2,1,-1],[-1,1,2]]}'
{
  "matrix": [
    [
      1,
      2,
      1
    ],
    [
      2,
      1,
      -1
    ],
    [
      -1,
      1,
      2
    ]
  ]
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "algebra.matrix_row_echelon",
  "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.

max_rows50
max_cols50
max_abs_entry1000000000000
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.

Partial pivoting improves numerical behavior, fixed rounding keeps JSON output stable, and strict validation rejects ragged matrices instead of guessing missing values.

What row echelon form shows

This implementation makes its choice reproducible through partial pivoting and does not scale pivot rows, so repeated calls with the same input always return the same JSON.

Preparing input and interpreting output

Send matrix as a nested JSON array, with one inner array per row. Every row must contain the same number of entries, and every entry must be a finite JSON number within the published magnitude limit. The response field row_echelon contains the transformed matrix, while pivots lists positions in the order they were chosen. For an augmented system, a row whose coefficient portion is all zero but whose augmented entry is nonzero signals inconsistency, though this endpoint leaves that interpretation to the caller because it does not know which column is augmented. Invalid input returns a clear invalid_input error, preventing silent padding, numeric coercion, or accidental acceptance of NaN and infinity.

Build deterministic test fixtures

Generate stable REF matrices and explicit zero-based pivots for unit tests covering square, rectangular, and rank-deficient inputs.

What does one API request cost?

A successful API request costs $0.002. The same deterministic calculation is available free in the browser runner.

Read the full KIT documentation →