Text diff checker
Runs in your browser; nothing is uploaded
Compare two versions of a text line by line, with the changed words highlighted.
Original
Modified
Differences
Nothing to compare yet
What is a text diff?
A diff shows how two versions of a text differ: which lines were removed, which were added and which stayed the same. It is the idea behind git diff, code review tools and the compare feature in most editors.
This tool matches lines the way diff and git do, with Myers' algorithm, which finds the smallest set of added and removed lines. A line that was edited appears as a removed line next to the added line that replaced it, and the words that changed inside it are highlighted.
For API work a diff answers questions such as what changed in a response since yesterday, why staging returns something different from production, or which fields a new API version added or dropped. Format both JSON responses the same way first, for example with the JSON formatter, so only real changes show up.
How to use this tool
- 1Paste or open the older version in Original and the newer one in Modified. You can drop a file on either editor. Examples has three pairs to try.
- 2Read the Differences pane: removed lines are red with
−, added lines green with+, and the changed words inside a line are highlighted. Switch between Side by side and Unified in the pane header. - 3Only changes folds long runs of unchanged lines to three lines around each change; click a folded row to open it. Use F7 and Shift+F7, or the arrows, to jump between changes.
- 4Use Ignore to leave out differences in whitespace, letter case or line endings (CRLF against LF). The status bar says when the texts differ only in line endings.
- 5Copy patch or Download patch gives the changes as a unified diff that
git applyandpatchaccept. Swap exchanges the two sides; Ctrl+Z undoes it one side at a time, and undoes Clear too.
Troubleshooting
- Every line shows as changed
- The texts probably use different line endings (CRLF from Windows against LF) or different indentation. The status bar reports line endings; turn on Ignore line endings or Ignore whitespace.
- Two JSON responses look completely different
- One is probably minified or indented differently. Format both with the same indent in the JSON formatter, then compare. Its Compare tab also diffs JSON by key, ignoring key order.
- The last line shows as changed although it looks the same
- One text ends with a line break and the other doesn't. Diff tools treat that as a change (the patch says
\ No newline at end of file). Ignore line endings leaves it out. - Pasted text never shows CRLF line endings
- Browsers turn every line break typed or pasted into a text field into LF, so CRLF can't survive a paste. Open the files with Open or by dropping them instead: the tool compares their line endings as they are on disk.
- Too large to compare
- Each side can hold up to 50,000 lines or 5 million characters. For bigger files use
git diff --no-index a.txt b.txtordiff -uon the command line.
Frequently asked questions
Why is a changed line shown as one removal and one addition?
Diffs compare whole lines. When anything on a line changes, the old line no longer matches, so it is listed as removed and the new one as added, next to each other. The highlighted words show what changed inside the line.
Does the patch follow the Ignore options?
No. The patch always describes the exact differences, including whitespace, case and line endings, so git apply and patch can apply it. The Ignore options only change what the Differences pane shows.
What does "shown as replaced" mean?
When two large texts have almost nothing in common, finding the smallest diff can take very long. After a fixed amount of work the tool shows the remaining region as removed and added in full. The result is still a correct diff, only less fine-grained.
Is my text uploaded anywhere?
No. The comparison runs in your browser. To survive a reload, what you paste is kept in this tab's session storage until you clear it or close the tab. Copy link puts the input in the link after #, which browsers never send to a server, but anyone you give the link to can read it. Your settings, such as the layout and the Ignore options, are saved in this browser.