Text diff
Compare two texts or code snippets with line, word, or character-level highlighting.
Paste an old version on the left and a new one on the right and the differences are highlighted immediately — added lines in green, removed in red, and inside a changed line the exact words or characters that moved. You get a similarity percentage, a jump-to-next-change control, and the option to export the result as a .patch file. Both texts stay in the browser; there is no upload and no diff is ever stored.
Key facts about Text diff
| Granularity | Line, word or character — word level is the default for prose, line for code |
|---|---|
| Layouts | Side by side, unified, and inline |
| Diff algorithm | Myers diff via the `diff` library, the same family of algorithm git uses |
| Similarity score | Unchanged lines as a percentage of total lines — 100 % means byte-identical after any folding you enabled |
| Noise controls | Ignore case, ignore whitespace, and collapse runs of more than three unchanged lines |
| Navigation | Jump between change hunks with the arrows, or press j and k |
| Input | Paste, clipboard button, or load a file — .txt, .json, .js, .ts, .py, .html, .css, .md, .yml, .xml, .csv, .sql, .sh, .go, .rs, .java, .c, .cpp, .rb, .php |
| Export | Copy the diff as text, or download it as a .patch file |
What happens to your file
Both texts are diffed by JavaScript in this tab. Loading a file uses the File API, which reads the file from disk into the page — it is not an upload, and no request is made. Nothing is sent to a server, nothing is written to storage, and the comparison disappears when you close the tab. That is the difference between this and pasting a configuration file into a hosted diff service.
About this tool
- 1
Paste the original
Left pane. Use the Paste button to pull it straight from the clipboard, or Upload to load a file from disk.
- 2
Paste the modified version
Right pane. Swap the two with the swap control if you pasted them the wrong way round.
- 3
Choose layout and granularity
Side by side for code, unified for a patch-style read, inline for prose. Then line, word or character.
- 4
Filter the noise
Turn on ignore whitespace or ignore case, and collapse unchanged runs, so only the real changes are left.
- 5
Navigate and export
Step through the hunks with the arrows or j/k, then copy the diff or download it as a .patch.
| Max size | No hard limit; word- and character-level diffs on files over a few hundred KB get slow because the work is quadratic in the worst case |
|---|---|
| Line endings | CRLF and LF are both accepted; turn on ignore whitespace to stop a line-ending change reporting every line as modified |
| Syntax | Language-agnostic — it compares text, so it works equally on JSON, YAML, prose or a CSV |
| Browser support | Any modern browser. The Paste button needs clipboard permission; typing or dragging always works |
| Network | None after page load |
- If every line shows as changed, the two files have different line endings — switch on ignore whitespace.
- Word granularity is what you want for prose; line granularity is what you want before a commit.
- Collapse unchanged lines on a long file: three lines of context either side of each hunk is usually enough to read a change.
- The .patch export is plain text in unified style — handy for pasting into a review, though it is not a git-applicable patch header.
- j and k step forward and back through changes without touching the mouse, as long as focus is outside the textareas.
- Line, word and character-level highlighting
- Side-by-side, unified and inline layouts
- Similarity percentage and added/removed counts
- Ignore case and ignore whitespace
- Collapse unchanged runs
- Keyboard hunk navigation (j / k)
- Load from file, copy diff, download .patch
- See exactly what changed between two versions of a source file before committing.
- Compare a staging and a production config without pasting either into a hosted service.
- Check what an editor altered in a contract or a policy document.
- Confirm a refactor produced byte-identical output by diffing the two results.
- Find the one changed value inside two large JSON responses.
Related tools
View allWorks well with this6
More in Data & Dev12
Updated