---
title: "Compare Excel Spreadsheets"
method: POST
path: "/excel"
---

# Compare Excel Spreadsheets

`POST /excel`

## Request

- Base URL: `https://api.diffchecker.com/public`
- URL: `https://api.diffchecker.com/public/excel`
- Auth: one of:
  - API key in header `X-Api-Key`
  - API key in query parameter `email`

Compute a diff between two spreadsheets. Supports both multipart/form-data file uploads and JSON with base64-encoded data URLs. Accepts .xlsx, .xls, and .csv files.

Columns are matched using headers and content, allowing renamed columns to remain paired.

## Query parameters

- `email` string, email
- `input_type` 'json' | 'form', required
- `diff_level` 'standard' | 'formulas'
- `ignore_whitespace` 'true' | 'false'
- `ignore_case_changes` 'true' | 'false'
- `hide_unchanged_rows` 'true' | 'false'
- `hide_unchanged_columns` 'true' | 'false'

## Headers

- `Diffchecker-Version` '1'

## Request body

- object
  - `left_spreadsheet` string, required: Data URL of the left spreadsheet (data:application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;base64,...).
  - `right_spreadsheet` string, required: Data URL of the right spreadsheet.
  - `left_sheet_name` string: The sheet name from the left spreadsheet to diff. If not provided, the first sheet will be used.
  - `right_sheet_name` string: The sheet name from the right spreadsheet to diff. If not provided, the first sheet will be used.
  - `left_header_row` integer: The row number to use as the header from the left spreadsheet. If not provided, the first row will be used.
  - `right_header_row` integer: The row number to use as the header from the right spreadsheet. If not provided, the first row will be used.

## Response `200`

Diff computed successfully.

- ExcelDiffResponse
  - `creditsUsed` integer, required: Credits charged for the diff request.
  - `table` array[], required: The diff results for each cell. Cells are organized by rows, with each row containing cells in column order (left to right). Each cell is represented by an array of one or two objects. If the cell value changed, there will be two objects (one removed, one inserted). Each object contains the `type` of change and the `value`. Cells equal under ignore options retain the original right-side value. A cell where a row present on one side meets a column present only on the other exists on neither side; it has an empty value and its row's type.
    - array[]
      - object[]
        - `value` string
        - `type` 'equal' | 'removed' | 'inserted' | 'moved'
  - `rows` object[], required: Row-level diff metadata. Row numbers are one-based relative to the selected header (row 1); null means absent. Filtering preserves source coordinates.
    - `type` 'equal' | 'removed' | 'inserted' | 'modified' | 'moved'
    - `original` integer, nullable
    - `new` integer, nullable
  - `columns` object[], required: Column-level diff metadata. Column numbers are one-based source positions; null means absent. Filtering preserves source coordinates.
    - `type` 'equal' | 'removed' | 'inserted' | 'modified' | 'moved'
    - `original` integer, nullable
    - `new` integer, nullable
  - `stats` object, required: Change counts cover the full comparison; row and column counts describe the visible output.
    - `moved` integer: Number of moved rows plus moved columns.
    - `inserted` integer: Inserted or modified data cells plus inserted or renamed column headers.
    - `removed` integer: Deleted or modified data cells plus deleted or renamed column headers.
    - `rows` integer: Total rows in the output, including the header when present.
    - `columns` integer: Total columns in the output.

## Other responses

- `400`: Invalid request data or spreadsheet content.
- `401`: Authentication failed. Provide a valid email or API key. Depending on the failure, the response can include more specific error codes.
- `404`: No endpoint matches the request path.
- `405`: The endpoint exists but does not support the request method. The `Allow` response header lists the methods it does support.
- `408`: Request timed out.
- `413`: The request exceeded the active size limit for the caller's authentication method or plan.
- `415`: The request Content-Type is not one this endpoint accepts. `/text` accepts only application/json; the upload endpoints accept application/json and multipart/form-data.
- `429`: Rate limit exceeded. Depending on the throttle, the response may also include `retryAfterSeconds` and a `Retry-After` response header.
- `500`: Spreadsheet diff failed due to a server-side processing error, or an unexpected server failure.

---

[API](https://skmtc.dev/diffchecker/apis/diffchecker-api.md) · [All operations](https://skmtc.dev/diffchecker/apis/diffchecker-api/llms.txt) · [OpenAPI document](https://skmtc.dev/diffchecker/apis/diffchecker-api/revisions/f2bb895fe9a7?raw)
