Text diff
Compare two texts and see the differences between them.
About Text diff
Compares two texts side by side and highlights the lines and characters that differ, using the same diff editor as Visual Studio Code. Both sides are editable, so you can fix a text and watch the differences disappear.
When you would use it
- Spotting what changed between two versions of a configuration file, a contract clause or a block of code.
- Checking that a copied or re-typed text matches the original exactly.
- Reviewing the output of a script against the expected result.
How to use it
- Paste the original text on the left and the modified text on the right.
- Changed lines are highlighted; within a line, the exact characters that differ are marked.
- Edit either side; the comparison updates as you type.
Things worth knowing
- The comparison is line-based first, then character-based within changed lines. Reordering lines shows up as a removal plus an addition, not as a move.
- Whitespace differences, such as tabs versus spaces or a trailing space, are real differences and are highlighted. If they are noise, normalise both texts first.
- Different line endings (Windows CRLF versus Unix LF) can make every line look changed. Convert the texts to the same line ending before comparing.
- Everything stays in your browser. Large texts work, but the editor can become slow beyond a few megabytes.
Frequently asked questions
- Why does every line show as changed?
- Usually because of invisible differences: line endings, indentation (tabs versus spaces) or trailing whitespace. Check a single line's highlighted characters to see which.
- Can I compare two files?
- Open each file in a text editor, copy its content and paste it into one side. The tool does not read files directly.