Text Diff Checker
About this tool
Paste two versions of a text, a config file or a piece of code and see exactly which lines were added, removed or changed. Inside a changed line, the words that differ are highlighted too.
Everything runs in your browser. Neither text is sent to a server.
How it works
- The comparison is line by line and finds a longest common subsequence of lines, so moved blocks show up as a removal and an addition.
- Ignore whitespace treats runs of spaces and tabs as one space and ignores leading and trailing spaces. Ignore case compares lines in lower case. The text shown is always your original.
- Line endings (Windows CRLF and Unix LF) are treated as the same, so a file saved on another system does not show every line as changed.
- Copy as unified diff produces the standard format with three lines of context (
@@ -1,4 +1,5 @@) thatgit applyandpatchunderstand. It marks a missing final line break with\ No newline at end of file. With Ignore whitespace or Ignore case ticked, lines that differ only in those ways are shown as unchanged in the copied diff, so it will not reproduce your second text exactly. It has no file header, so add---and+++lines if the tool you use needs them. - To keep the page responsive, very large changes are refused: after removing identical lines at the start and end, the product of the remaining line counts must stay under 25 million (about 5,000 changed lines on each side).
FAQ
Q. Why is a line shown as changed when it looks identical?
A. Differences you cannot see, such as trailing spaces, tabs instead of spaces, or look-alike characters, count. Tick Ignore whitespace to hide the first two.
Q. Can it compare files?
A. Open the file in a text editor and paste its content. For whole folders or binary files, use a tool such as git diff or diff -r.