Examples
-
Text A
line one line two line three -
Text B
line one line TWO line three line four
About Text Diff
Our JSON Compare tool understands JSON structure specifically - key order, nested objects, types. Most files aren't JSON: nginx configs, .env files, log excerpts, a function before and after a refactor. Those still need a line-by-line diff, just without any JSON-aware parsing getting in the way.
Paste two versions of a text block and get back every line marked as added, removed, or unchanged, computed with a standard longest-common-subsequence line diff - the same underlying idea `diff` and most "compare" features in editors use.
Because it's line-based, moving a block of text around registers as a removal plus an addition rather than a "move" - which is the same tradeoff most line-diff tools make, in exchange for being simple and predictable.
FAQ
- Does this diff word-by-word or character-by-character?
- No, it compares whole lines. A single changed character marks the entire line as different - use it to spot which lines changed, then look within the line for the specific edit.
- Should I use this or JSON Compare for JSON files?
- Use JSON Compare for JSON - it understands structure and key semantics. This tool is for everything that isn't JSON, or when you specifically want a literal line-by-line view.