Text diff checker
Compare two text blocks and see what changed.
Paste text into both boxes and click Compare. Works well for code, config files, and prose.
About this tool
Quickly see what changed between two versions of text — a config file before and after an edit, two drafts of a README, an old log next to a new one, or the JSON a colleague sent you versus the JSON you actually have. Paste the original on the left and the new version on the right; the comparison runs the instant either side changes — no submit button. Everything happens in your browser, so passwords, API keys, or client data sitting in the text never leave your device.
Under the hood this is the same idea as git diff: a longest-common-subsequence (LCS) match finds the largest set of lines the two versions share, then marks everything else as added or removed. Added lines show in green, removed in red, and unchanged in grey, with modified line-pairs side by side so a one-character change reads at a glance. A summary above the panes counts additions, deletions, and modifications, so you can gauge the size of a change before you read it.
Two modes cover most jobs. Line diff compares a whole line at a time and suits code, config, and logs, where edits tend to add or remove entire lines. Word diff works token by token and is better for prose, where a paragraph might change by only a word or two — a line view would flag the whole paragraph as rewritten. Toggles for "ignore leading/trailing whitespace" and "ignore case" cut the noise when the real change is buried under reindentation or casing.
How to use this tool
-
Paste the original
Into the left pane. Plain text, code, JSON, config, logs — anything text-based. Whitespace is preserved exactly, so indentation changes show up.
-
Paste the new version
Into the right pane. The diff regenerates every time either side changes — no submit button. Files of a few thousand lines stay responsive.
-
Read the highlights
Added lines appear in green, removed in red, and modified line-pairs sit side-by-side so you can read the change at a glance. The summary above the pane counts additions, deletions, and modifications.
Frequently asked questions
What's the difference between line and word diff?
Line diff compares one line at a time — best for code and config files where a whole line is added or removed. Word diff works token-by-token and is better for prose, where a sentence may have only a word or two changed.
Is this the same as git diff?
Same underlying idea (longest common subsequence) but much simpler: no patch hunks, no context lines, no file headers. Good for quick ad-hoc comparisons when you don't have the two files in a git repo.
Will large files work?
It handles reasonable inputs (tens of thousands of lines) comfortably. The algorithm is O(n·m) in memory, so pasting two novels will slow it down — for that you'd want a real diff tool locally.
Why are my diffs so noisy with reformatted code?
Diff algorithms work on lines. Reformatting (changing indentation, splitting one line into many) makes every changed line look new even when the meaning is identical. The fix is to compare after running both through the same formatter — or to compare token-level rather than line-level (some tools do).
Does this work for binary files or just text?
Text only. Diffing binary files needs format-specific tools (vimdiff for some binaries, dedicated tools for images / PDFs / spreadsheets). For text — code, prose, JSON, config — this is what you want.
Troubleshooting
- The whole file shows as changed when I only edited one line
Almost always line endings. A file saved on Windows uses
CRLF(carriage-return + line-feed); one saved on Linux or macOS usesLF. If the two sides came from different systems, every single line differs by an invisible character, so the diff marks all of them. Normalise both to the same line ending — most editors have a "CRLF → LF" conversion in the status bar — then compare again.- Every line went red and green after I reformatted the code
Diffs work on lines, not on meaning. Reindenting, re-wrapping, or splitting one statement across several lines makes each affected line look brand new even though the code does exactly the same thing. Run both versions through the same formatter (Prettier, Black,
gofmt) before comparing, or switch to word diff so only the genuinely changed tokens light up.- Two lines look identical but the diff says they differ
There's a difference you can't see: trailing spaces, a tab where the other side has spaces, or a non-breaking space pasted from a web page. Turn on "ignore leading/trailing whitespace" to rule out the first case. If the lines still differ, the gap is mid-line — reveal invisible characters in your editor to find it.
- The page gets slow or freezes on very large inputs
The comparison is O(n·m) in time and memory, so it scales with the product of the two sizes. Tens of thousands of lines are fine; pasting two entire books is not. Diff the relevant section rather than the whole file, or for huge inputs use a local tool like
git diffordiffon the command line.