What this tool does
Compares two pieces of text and shows the differences either side-by-side or as a unified diff. Optional toggles ignore leading/trailing whitespace and ignore case. The diff is computed over lines (not characters), which is what you want for code, configs, and prose.
When you'd use it
- Spotting what changed between two API responses.
- Reviewing edits to a config file when you don't have the version in git.
- Comparing two error messages to find the one differing word.
- Sanity-checking that a copy-paste round-trip didn't insert invisible characters.
How it works
The algorithm is a longest common subsequence (LCS) computation, which is the same approach git diff uses. The complexity is roughly O(n × m) in the line counts, so we cap inputs at 2,500 lines per side to keep performance predictable. Matching lines are paired up; lines that exist only on one side are flagged as additions or deletions.
Notes
Why line-by-line and not character-by-character? Because most real diffs are about lines. Character-level diffs are noisy on anything longer than a sentence. If you need a true character diff, use git diff --word-diff locally.
Does ignore-whitespace ignore tabs vs. spaces? Yes — that toggle treats any run of whitespace as equivalent to any other, which is useful when one file was reformatted but the content is otherwise the same.
What happens beyond 2,500 lines? The tool refuses to render and asks you to trim. LCS is quadratic; at 100k lines you'd freeze the tab for minutes.
Related tools
- JSON Formatter — pretty-print first, then diff
- JSON ↔ YAML — convert to a stable shape before diffing