Text Diff Tool
Compare two texts and highlight differences word-by-word or line-by-line
⏳Loading...
About Text Diff
A diff answers one question: what changed between these two versions? Paste the original on the left and the revision on the right, and every insertion, deletion and rewrite is marked in place. It is the same idea behind the review view in Git or the tracked changes in a word processor, without needing either of them installed or the files committed anywhere.
Choosing a comparison mode
- Word Diff compares token by token. A paragraph where one adjective changed shows just that adjective, so the surrounding sentence stays readable. Reach for it with prose, documentation, translations and marketing copy.
- Line Diff treats a whole line as the unit, so any edit marks the line as removed and re-added. That sounds coarser, and it is, but it matches how code, logs and configuration are actually reviewed: you want to know which lines moved, not which characters did.
Reading the result
Three states, and only two of them are coloured:
- Green is in the new text but not the original. It was added.
- Red is in the original but not the new text. It was removed.
- Unstyled text is identical in both and can be skimmed past.
A rewritten passage has no separate colour of its own. It appears as the old wording in red followed immediately by the new wording in green, because that is literally what happened to it.
What people use it for
Reviewing edits: comparing a draft against the version that came back from a colleague, an editor or a client, so you can see what they actually touched rather than rereading the whole thing.
Contracts and policies: checking a returned agreement against the copy you sent. A single reworded clause is easy to miss by eye and impossible to miss here.
Configuration drift: comparing the config on one machine against another when only one of them works. Line diff usually finds it in seconds.
Logs and output: putting a failing run beside a passing one to isolate the first line where they diverge.
Code review offline: comparing two snippets without creating a branch, a commit or a pull request.
Getting cleaner comparisons
- Normalise formatting first. If one side has been reindented or reformatted, every line reads as changed and the real edit is buried. Run both through the JSON Formatter or the Markdown Editor before comparing.
- Watch for invisible differences. Trailing whitespace and a switch between Windows and Unix line endings both count as changes, which is often the explanation when a diff claims everything changed and nothing looks different.
- Compare sections rather than whole documents when the files are large. A shorter diff is a diff you will actually read.
Privacy
The comparison runs in your browser. Both texts stay in the tab, nothing is uploaded, and nothing survives closing the page. That matters more for this tool than for most: the things worth diffing tend to be contract drafts, production logs and unreleased code, which are exactly the things you would not want to paste into an online service.
Frequently Asked Questions
What is the difference between word diff and line diff?
Word diff compares the two texts token by token, so a sentence where one adjective changed is reported as that one word changing. Line diff treats a whole line as the unit, so any edit marks the entire line as removed and re-added. Word diff reads better for prose, translations and copy review. Line diff reads better for code, logs and configuration, where you care which lines moved rather than which characters did.
Is my text uploaded anywhere when I compare it?
No. The comparison runs in JavaScript inside your own browser tab. Nothing is sent to a server, nothing is logged, and nothing is stored after you close the page. That is what makes it safe to paste contract drafts, production logs or unreleased code, which is usually the sort of thing you least want to hand to an online service.
How do I read the colours in the result?
Green marks content present in the new text but not the original, so it was added. Red marks content present in the original but missing from the new text, so it was removed. Anything left unstyled is identical in both. When a passage was rewritten rather than inserted, you will see the old wording in red immediately followed by the new wording in green.
Can it compare code, JSON or other structured text?
Yes. The tool is format agnostic and compares whatever characters you paste, so source files, JSON, YAML, SQL and CSV all work. For structured formats, line diff is usually the mode you want. If a JSON file has been reformatted, run it through the JSON Formatter first so both sides use the same indentation, otherwise every line reads as changed.
Is there a size limit on the text I can compare?
There is no fixed limit, only what your device can comfortably hold in memory. Documents of a few thousand lines compare instantly. Very large inputs, in the order of megabytes, may take a moment because the whole comparison happens on the main thread rather than on a server.