Text Compare (Diff)
Compare two texts line by line and get a unified diff showing exactly what was added, removed or changed.
Paste or drop
Paste text below, or drop a file instead.
Choose an output
Compare two texts line by line and get a unified diff showing exactly what was added, removed or changed.
Fine-tune
Optional — sensible defaults are already set.
About Text Compare (Diff)
Paste an original version on one side and a changed version on the other to see exactly which lines were added, removed or changed. The output is a standard unified diff, the same format used by git and the Unix diff command, so it can be read by people and applied as a patch.
When it helps
- Checking what an editor or co-author changed in a draft or contract.
- Comparing two versions of a config file, SQL query or code snippet.
- Confirming that two exports or lists are identical before replacing one with the other.
- Producing a .diff file to attach to a bug report or code review.
Tips
- Lines starting with '-' were removed, lines with '+' were added, and a changed line appears as one removal followed by one addition.
- 'Context lines' sets how many unchanged lines are shown around each change. Use 0 for only the changes, or a higher number to see more of the surrounding text.
- Turn on 'Ignore whitespace changes' when re-indentation or trailing spaces would otherwise mark every line as changed.
- The comparison works line by line. For prose, putting each sentence on its own line gives a more precise result.
Good to know
Quick answers about text compare (diff) in your browser.
Each block starts with a header like @@ -12,5 +12,6 @@, meaning the block covers 5 lines from line 12 of the original and 6 lines from line 12 of the changed text. Lines without a + or - prefix are unchanged context.
Yes. The file uses the standard unified format with 'original' and 'changed' as the file names, so tools like patch or git apply can read it once you adjust those names to your real file paths.
Yes. There is no sign-up, no watermark and no limit on how many files you process.
No. Files are read and processed locally in your browser, so they never leave your device.
Related tools
Part of the Text Tools collection.