Text Diff
See exactly what changed between two texts.
- Local by default
- No signup
- AI is opt-in
Difference
Paste two versions to see what changed. Comparison runs as you type, in this tab.
Paste two versions of a text to see exactly what changed, line by line or word by word. Filter out whitespace and case noise, then copy a unified patch you can apply with standard tools. The comparison runs in this tab.
How the comparison works
The tool computes a shortest edit script with Myers' difference algorithm, the same family of algorithm used by git diff. It walks both sequences and records three operations: keep a line, delete a line, or insert a line. The result is the smallest set of changes that turns the original into the modified text.
The implementation progressively increases the number of allowed edits and stops as soon as both inputs are consumed. That is why similar files compare instantly while two unrelated documents cost more work. If the two sides are so different that the edit distance exceeds the internal cap, the view falls back to a full replacement instead of hanging the tab.
Line mode versus word mode
Line mode is the right default for code, configuration and Markdown. Each row shows the old line number, the new line number, a - or + marker and the line itself. Line mode is also the only mode that can produce a unified patch, because patch formats operate on lines.
Word mode tokenises on whitespace and highlights the specific words that changed inside a line. It is better for prose, release notes and documentation, where a one-word edit should not repaint an entire paragraph. The trade-off is that it has no line numbers and cannot be exported as a patch.
Word mode splits on whitespace, so languages written without spaces, such as Chinese or Japanese, are compared as longer tokens. For those texts, line mode usually gives a clearer picture.
Reading a unified patch
--- a/original.txt
+++ b/modified.txt
@@ -1,3 +1,4 @@
Release notes
-Version 1.0
+Version 1.1
Works offline.
+Added: shareable links.The two header lines name the files. Each @@ block is a hunk: -1,3 means the hunk covers three lines starting at line 1 in the original, and +1,4 means four lines starting at line 1 in the modified file. Inside the hunk, a leading space is an unchanged context line, - is a removal and + is an addition.
Hunks include three lines of context by default, which is enough for patch and git apply to locate the change reliably. Save the download as changes.patch and apply it with patch -p1 < changes.patch from the project root. The generated file names are a/original.txt and b/modified.txt, so rename them or edit the header if your real paths differ.
Whitespace, case and line endings
Ignore whitespace normalises runs of spaces, tabs and newlines before comparing. It is useful when one side is reformatted or re-indented, but it does not rewrite the displayed lines: you still see the original text on each row. Ignore case lowercases both sides for comparison only, so Content-Type and content-type are treated as equal.
Line endings are not normalised automatically. A file with CRLF line endings and the same file with LF endings will appear completely different, because every line differs by a trailing carriage return. Convert line endings first if that is the only change you expect.
A trailing newline also matters. Ending a file with or without a final newline produces a real difference in the last line, and some tools render that difference in a way that looks like an empty change. Check the last row before assuming the diff is wrong.
Limits and what this is not
Line comparison accepts up to 5,000 lines per side, and word comparison accepts up to 20,000 tokens per side. Those limits keep the algorithm responsive in a browser tab; they are not a statement about how large a patch can be. For big files, use a desktop diff tool with a streaming implementation.
This is a text comparison, not a semantic one. Reordered JSON keys, reformatted SQL or equivalent regular expressions all show up as raw text changes. If you need to compare data by meaning, parse both sides first and compare the parsed values.
Frequently asked questions
Is my text uploaded?
No. The diff is computed in JavaScript in your browser, and there is no upload request. You can confirm with the network panel while typing.
What is a unified patch and how do I apply it?
It is a plain-text description of line changes with surrounding context. Save it as a .patch file and run patch -p1 < changes.patch from the directory above the files, or use git apply. The generated header uses a/original.txt and b/modified.txt, so adjust the paths if needed.
Can I ignore indentation changes?
Yes. Enable Ignore whitespace. The comparison collapses whitespace runs before matching, so re-indented blocks that are otherwise identical stop showing as changes. The displayed lines are still the original ones.
Why does the tool say the texts are very different?
The underlying algorithm stops after a fixed number of edits to keep the tab responsive. When the two inputs exceed that budget, the result is shown as a full replacement. Split the files into smaller sections if you need a precise diff.
Does it handle Unicode and emoji?
Yes. Comparison works on JavaScript strings, so Unicode text and emoji are handled correctly. Word mode still splits on whitespace, which means a sentence in a language without spaces is treated as one large token.
Can I compare two JSON files structurally?
Not here. This is a text diff, so key order and formatting count as changes. To compare JSON by value, format and sort keys first with the JSON formatter, then paste the results here.