# Diff checker

> Compare two texts side by side or inline, and download a unified patch.

Free diff checker for text and JSON. Compare by line, word, or character, ignore whitespace, or diff JSON so key order does not matter. The result is a side-by-side view, an inline view, and a unified patch. It runs in the browser.

- Page: https://benchline.fabwaseem.com/t/diff-checker
- Runs: in the browser. Input stays on the device.
- Price: free, no account
- Input: Two texts, a mode of line, word, character, or JSON, and an ignore-whitespace toggle.
- Output: A side-by-side or inline diff, added and removed counts, and a unified patch.
- Keywords: diff checker, compare text, text diff, json diff
- Updated: 2026-10-18
- Built by: Waseem Anjum (https://fabwaseem.com)

## How to use it

1. **Paste the two texts.** Original goes on the left, changed on the right. Swap them if you pasted them backwards.
2. **Choose how to compare.** Line is the default. Word and character zoom in. JSON compares values and ignores key order.
3. **Read the view or the patch.** Switch between side by side and inline. The patch is in the side panel, ready to copy.

## Use it from an AI agent

MCP tool name: `diff_text`
MCP endpoint: https://benchline.fabwaseem.com/mcp (Streamable HTTP, no key)
HTTP: POST https://benchline.fabwaseem.com/api/v1/tools/diff-checker with the input as the JSON body
This call does not fetch anything. It runs on the arguments you send.

Compare two texts by line, word, or character, or compare JSON so object key order does not matter. Returns an inline diff, side-by-side rows for line and JSON modes, and a unified patch.

### Input schema

```json
{
  "type": "object",
  "properties": {
    "left": {
      "type": "string",
      "description": "The original text."
    },
    "right": {
      "type": "string",
      "description": "The changed text."
    },
    "mode": {
      "default": "line",
      "type": "string",
      "enum": [
        "line",
        "word",
        "char",
        "json"
      ]
    },
    "ignoreWhitespace": {
      "default": false,
      "type": "boolean"
    }
  },
  "required": [
    "left",
    "right",
    "mode",
    "ignoreWhitespace"
  ],
  "additionalProperties": false
}
```

### Example tools/call

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "diff_text",
    "arguments": {
      "left": "example",
      "right": "example",
      "mode": "line",
      "ignoreWhitespace": false
    }
  }
}
```

Setup for Claude, Cursor, and VS Code: https://benchline.fabwaseem.com/mcp/guide

## Questions

### What is the difference between side by side and inline?

Side by side pairs removed and added lines in two columns. Inline paints the same changes in one stream, in the order the diff found them.

### What does ignore whitespace do?

Line mode treats lines as equal when only leading or trailing whitespace differs. Word mode ignores spaces between words. Character mode removes whitespace before comparing.

### How does the JSON diff work?

Both sides must be JSON. Keys are sorted before the comparison, so a reordered object is unchanged. A value change is shown as a line diff of the canonical document. A syntax error names the side, the line, and the column.

### Is the patch ready to apply?

The unified patch uses three lines of context and the names original and changed. JSON mode patches the canonical documents, named original.json and changed.json.

## Related tools

- [JSON formatter](https://benchline.fabwaseem.com/t/json-formatter): Pretty-print, minify, and validate JSON, with the exact line and column when it fails.
- [JSON YAML converter](https://benchline.fabwaseem.com/t/json-yaml-convert): Convert JSON, YAML, TOML, and XML in the browser, and keep the line number when a document fails.
- [CSV JSON converter](https://benchline.fabwaseem.com/t/csv-json-convert): Convert CSV to JSON and JSON back to CSV, with a delimiter and a header row you choose.
- [Cron expression builder](https://benchline.fabwaseem.com/t/cron-expression-builder): Build or paste a cron schedule, read it in plain English, and see the next run times.
