Text Diff Checker
Compare two texts and highlight every added and removed line, word or character, side by side or in a unified view.
This guide is not yet available in your language and is shown in English.
Tool guide
What this tool does
Text Diff Checker shows exactly what changed between two versions of a document, list or code snippet. Compare by line, word or character, ignore case or whitespace, and download the differences as a standard unified .diff patch.
Spotting the difference between two versions of a contract clause, a translated paragraph or a configuration file by eye is slow and unreliable; a changed digit or a missing “not” is easy to miss. Version control systems solve this for code, but most text is not in a repository, and pasting both versions into a document rarely helps.
This checker uses the Myers difference algorithm, the same approach behind git diff, through the open-source jsdiff library, which is loaded only when you start comparing. Line mode lists inserted and deleted lines with their original and new line numbers; word and character modes mark changes inline, which suits prose and short strings. Windows line endings are normalised first so they do not show up as false changes. Both texts are compared on your own device.
How to use Text Diff Checker
- Paste the earlier version into “Original text” and the newer version into “Changed text”, or click Sample in each box.
- Choose “Compare by”: Lines for code and lists, Words for prose, Characters for IDs, numbers and short strings.
- In line mode, switch View between Unified and “Side by side”.
- Turn on “Ignore case” or “Ignore whitespace differences” to hide changes that do not matter to you.
- Read the Added, Removed and Unchanged totals, then scan the highlighted Differences panel.
- Click “Download .diff patch” to save the changes in unified diff format, or use “Swap texts” to reverse the direction.
Tips for better results
- Word mode is usually the most readable choice for edited articles, because a single changed word does not mark the whole line as different.
- Re-wrapped paragraphs look completely changed in line mode; compare them in word mode instead.
- A unified patch with three lines of context can be applied with the patch command or git apply on another machine.
- Ignore whitespace in line mode skips leading and trailing spaces only, so indentation changes inside Python or YAML are hidden; turn it off when indentation matters.
Common use cases
- Checking what a colleague changed in a shared policy document before approving it.
- Comparing two exported configuration files to find the setting that differs between servers.
- Reviewing edits a proofreader or translation tool made to your copy.
- Confirming that two long ID or key strings are identical character for character.
Common mistakes to avoid
- Comparing texts where one has been reflowed, then reading every line as rewritten; switch to word comparison.
- Leaving “Ignore case” on when checking passwords, codes or identifiers where case is significant.
- Putting the newer text in the Original box, which turns every addition into a removal; use Swap texts to fix it.
Frequently asked questions
Which algorithm does the diff checker use?
It uses Eugene Myers’ O(ND) difference algorithm via the jsdiff library. The algorithm finds the smallest set of insertions and deletions that turns the original into the changed text, which is why results match what developers see in git.
How large can the texts be?
Texts of several hundred thousand characters compare comfortably. Very different large inputs are limited to eight seconds of work so the tab never hangs; if that limit is reached, compare by lines or split the text.
What is in the downloaded .diff file?
A unified diff with original.txt and changed.txt headers, hunk ranges marked with @@ and three lines of unchanged context around each change, the format accepted by patch, git apply and most code review tools.
Are my documents uploaded for comparison?
No. The comparison library runs in the page itself, so both versions stay in your browser and nothing is sent to a server.
Feedback & suggestions
Help us improve Text Diff Checker. We read every message.