Diff two texts
diff_textCompare text a with text b by lines (default), words or chars. Returns ops (equal/insert/delete), a unified diff (lines mode), optional escaped HTML redline, stats and similarity. Deterministic diff (Myers algorithm via jsdiff), not an AI or semantic comparison. Limits per side: lines mode 64 KB and 1,000 lines, words mode 8 KB, chars mode 4 KB. If the texts need more than 250 inserted plus deleted units, the API returns 422 too_different instead of a partial diff. Patches up to 64 KB apply to text up to 64 KB. No 3-way merge, no binary files. Stateless: text is not stored or logged; no URL fetching.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| a | Yes | Original text. | |
| b | Yes | Changed text. | |
| mode | No | ||
| context | No | ||
| formats | No | ||
| label_a | No | ||
| label_b | No | ||
| ignore_case | No | ||
| ignore_whitespace | No | lines mode only |