T
🗂️🧩
🔍Developer

Online Diff Checker

Paste two pieces of text to instantly see additions, deletions, and unchanged lines highlighted. Supports split view and unified view, ignore whitespace, ignore case, and comes with code and JSON samples.

Paste text into both panels above to see the diff
or load a sample →
Was this result accurate?

What a Diff Checker Actually Shows You (Beyond "Different")

A diff checker does more than tell you two texts aren't identical — it shows you exactly where they diverge and how. When you paste two versions of anything into this tool, it analyzes them line by line and categorizes each line into three buckets: additions (lines present only in the second text), deletions (lines present only in the first), and unchanged lines that appear in both. The result is a visual map of change.

This matters because knowing something changed is rarely enough. If your coworker edited a 200-line configuration file and says "I fixed it," you need to know what they fixed. Did they change one value from 30 to 60? Did they delete an entire section? A diff shows you the surgery, not just the scar. The tool highlights additions in green and deletions in red, with unchanged context lines shown normally so you can see where changes occurred relative to the rest of the document.

Frequently Asked Questions

Is my data sent to a server?

No. The diff is computed entirely in your browser using JavaScript. Your text never leaves your device.

What diff algorithm is used?

The tool uses the Myers diff algorithm — the same algorithm used by Git, GNU diff, and most modern version control systems.

What does 'ignore whitespace' do?

When enabled, leading and trailing spaces are trimmed from each line before comparison. Lines that differ only in indentation will be treated as equal.

How the Myers Diff Algorithm Finds the Shortest Edit Path

This tool uses the Myers diff algorithm, the same method powering Git and GNU diff. The algorithm frames comparison as a graph problem: imagine a grid where the first text runs along one axis and the second along the other. Moving right means deleting a character, moving down means inserting one, and moving diagonally means the characters match. Myers finds the shortest path from corner to corner — the minimum edits needed to transform text A into text B.

Consider comparing "cat" to "cut". The algorithm identifies that 'c' matches, then 'a' must become 'u' (one deletion, one insertion), and 't' matches. That's an edit distance of 2. For longer texts, Myers uses clever optimizations to avoid checking every possible path, making it fast enough to compare thousands of lines in milliseconds. The output groups consecutive changes into hunks, showing you not just individual edits but clusters of related modifications with surrounding context lines.

Tracking Down a Bug in Your JSON Configuration

Say you're debugging a web application that suddenly stopped connecting to its database. You have two config files: yesterday's backup that worked and today's version that doesn't. Both files are 47 lines of JSON. Scrolling through them manually, everything looks identical. Paste the working version into the left panel and the broken version into the right.

The diff immediately highlights line 23: your database port changed from 5432 to 54321. Someone added an extra digit, probably a typo during a late-night edit. Without the diff, you might have spent an hour checking credentials, firewall rules, and network settings. The unified view shows this single change with three lines of context above and below, confirming nothing else was modified. You fix the typo, and the connection works again. This scenario plays out constantly in software development — one character can break everything, and a diff finder locates that character in seconds.

Beyond Code: Comparing Contracts, Translations, and API Responses

Most people reach for a diff tool only when comparing code, but text comparison solves problems in unexpected places. Legal professionals comparing contract revisions can paste two versions of a 15-page agreement and instantly see every clause that changed between drafts. When a vendor claims "we only updated the payment terms," the diff reveals they also modified the liability section and the termination clause. This turns a tedious paragraph-by-paragraph review into a focused examination of actual changes.

Translators working with updated source documents face a similar challenge. If your client sends a revised 3,000-word document and says "a few things changed," the diff shows you precisely which sentences need re-translation rather than forcing you to re-read everything. API developers use diffs to compare JSON responses before and after a service update, catching subtle field name changes or new required parameters. The "ignore whitespace" option helps here — it treats two JSON objects as identical even if one is minified and the other is pretty-printed.

Common Diff Mistakes That Lead to Wrong Conclusions

The most frequent error is comparing texts with different line endings. A file created on Windows uses CRLF endings while Linux uses LF. The diff might show every single line as changed even though the actual content is identical. If you see a diff that marks everything as modified, copy both texts into a plain text editor first and normalize the line endings before comparing again.

Another mistake is forgetting about the "ignore case" setting when it matters. Comparing "UserName" to "username" shows no difference when case-insensitivity is enabled, which could hide a bug in case-sensitive systems. Use this option deliberately, not as a default. Finally, people sometimes paste partial texts and wonder why the diff seems wrong — the tool compares exactly what you give it. If you copied from line 50 to line 100 in one panel but line 48 to line 102 in the other, those extra lines will appear as additions or deletions. Always verify your selections before drawing conclusions from the results.

What a Diff Checker Actually Shows You (Beyond "Different")

A diff checker does more than tell you two texts aren't identical — it shows you exactly where they diverge and how. When you paste two versions of anything into this tool, it analyzes them line by line and categorizes each line into three buckets: additions (lines present only in the second text), deletions (lines present only in the first), and unchanged lines that appear in both. The result is a visual map of change.

This matters because knowing something changed is rarely enough. If your coworker edited a 200-line configuration file and says "I fixed it," you need to know what they fixed. Did they change one value from 30 to 60? Did they delete an entire section? A diff shows you the surgery, not just the scar. The tool highlights additions in green and deletions in red, with unchanged context lines shown normally so you can see where changes occurred relative to the rest of the document.

How the Myers Diff Algorithm Finds the Shortest Edit Path

This tool uses the Myers diff algorithm, the same method powering Git and GNU diff. The algorithm frames comparison as a graph problem: imagine a grid where the first text runs along one axis and the second along the other. Moving right means deleting a character, moving down means inserting one, and moving diagonally means the characters match. Myers finds the shortest path from corner to corner — the minimum edits needed to transform text A into text B.

Consider comparing "cat" to "cut". The algorithm identifies that 'c' matches, then 'a' must become 'u' (one deletion, one insertion), and 't' matches. That's an edit distance of 2. For longer texts, Myers uses clever optimizations to avoid checking every possible path, making it fast enough to compare thousands of lines in milliseconds. The output groups consecutive changes into hunks, showing you not just individual edits but clusters of related modifications with surrounding context lines.

Tracking Down a Bug in Your JSON Configuration

Say you're debugging a web application that suddenly stopped connecting to its database. You have two config files: yesterday's backup that worked and today's version that doesn't. Both files are 47 lines of JSON. Scrolling through them manually, everything looks identical. Paste the working version into the left panel and the broken version into the right.

The diff immediately highlights line 23: your database port changed from 5432 to 54321. Someone added an extra digit, probably a typo during a late-night edit. Without the diff, you might have spent an hour checking credentials, firewall rules, and network settings. The unified view shows this single change with three lines of context above and below, confirming nothing else was modified. You fix the typo, and the connection works again. This scenario plays out constantly in software development — one character can break everything, and a diff finder locates that character in seconds.

Beyond Code: Comparing Contracts, Translations, and API Responses

Most people reach for a diff tool only when comparing code, but text comparison solves problems in unexpected places. Legal professionals comparing contract revisions can paste two versions of a 15-page agreement and instantly see every clause that changed between drafts. When a vendor claims "we only updated the payment terms," the diff reveals they also modified the liability section and the termination clause. This turns a tedious paragraph-by-paragraph review into a focused examination of actual changes.

Translators working with updated source documents face a similar challenge. If your client sends a revised 3,000-word document and says "a few things changed," the diff shows you precisely which sentences need re-translation rather than forcing you to re-read everything. API developers use diffs to compare JSON responses before and after a service update, catching subtle field name changes or new required parameters. The "ignore whitespace" option helps here — it treats two JSON objects as identical even if one is minified and the other is pretty-printed.

Common Diff Mistakes That Lead to Wrong Conclusions

The most frequent error is comparing texts with different line endings. A file created on Windows uses CRLF endings while Linux uses LF. The diff might show every single line as changed even though the actual content is identical. If you see a diff that marks everything as modified, copy both texts into a plain text editor first and normalize the line endings before comparing again.

Another mistake is forgetting about the "ignore case" setting when it matters. Comparing "UserName" to "username" shows no difference when case-insensitivity is enabled, which could hide a bug in case-sensitive systems. Use this option deliberately, not as a default. Finally, people sometimes paste partial texts and wonder why the diff seems wrong — the tool compares exactly what you give it. If you copied from line 50 to line 100 in one panel but line 48 to line 102 in the other, those extra lines will appear as additions or deletions. Always verify your selections before drawing conclusions from the results.

Related Tools