Diff Viewer
Understand Diff Viewer
This viewer compares two blocks of text line by line and marks which lines were added, removed, or left alone.
How it works
Both inputs are split on newlines and the tool computes the longest common subsequence of those lines — the longest ordering of lines that appears in both sides, in order. Everything on that subsequence is unchanged; every other line on the left is a deletion and every other line on the right is an insertion. The table it fills in is lines(A) × lines(B) entries, which is why very large inputs get slow.
When to use it
- Comparing a config file between two environments.
- Checking what actually changed between two API responses.
- Reviewing generated output before and after a change to the generator.
- Comparing text pasted from two places when neither is in version control.
Watch out for
- The unit is a whole line. Changing one character marks the line removed and re-added, with no highlight of the character that moved.
- Invisible differences count. Trailing spaces, and Windows CRLF endings against Unix LF, make every line differ — that is the usual explanation for a diff where nothing matches.
- A moved block is not detected as a move. A section cut from the top and pasted at the bottom appears as a large deletion plus a large insertion.
- For JSON, format both sides first. Otherwise indentation and key ordering swamp the change you were looking for.
Frequently Asked Questions
How to compare two text files?
Paste the contents of each file into the left and right panels and click Compare. Added lines are highlighted green, removed lines red, and unchanged lines grey. You can also upload files directly. The diff runs entirely in your browser — no files are uploaded to a server.
How to compare text in Excel?
For Excel cell comparison, copy the contents of each cell/column into the two panels. This tool compares line by line — one row per line. For large spreadsheet diffs, exporting both sheets as CSV and comparing the CSV text is the most reliable approach.
How to compare text files in Notepad++?
In Notepad++, install the Compare plugin (Plugins → Plugins Admin → Compare), open both files, then go to Plugins → Compare → Compare. This online diff checker is a zero-install alternative — paste both file contents and see side-by-side differences immediately.
How to Use Diff Viewer
- Paste or type your input in the input area above.
- The tool processes your input automatically or click Run.
- Copy or download the result using the action buttons.
- Use Ctrl+Enter to run quickly from the keyboard.