Compare Two Texts Online: Free, Private Diff Checker
A text diff tool compares two versions of a text and shows what was added, removed or left unchanged. To compare two texts online with this free diff checker, paste the original into Original Text and the new version into Modified Text. Removed text turns red, added text turns green, and the tool counts the changes by line, word or character. Nothing is uploaded: the comparison runs in your browser, and you can check the Network tab in your browser's DevTools.
The comparison updates as you type. Choose Side-by-Side or Inline under View Mode, pick Line, Word or Character under Diff Level, then export with Copy Diff Report, Download HTML or Download .patch. The engine is Myers' diff algorithm, the same family of method used by GNU diff and Git, so it finds a shortest list of edits whenever the texts are close enough to compare exactly.
Before comparing, tidy both versions the same way so only real edits remain: run the line sorter on two lists, strip spacing with remove empty lines, or format JSON with the JSON formatter so key order and indentation line up.
Text Diff Table of Use: Inputs and Results
Counts below come from running the real comparison on each pair.
| Use case | Original and Modified | Setting | Result |
|---|---|---|---|
| Config file change | port=8080 and debug=false become port=9090 and debug=true; host=localhost is unchanged | Line | Added 2, Removed 2, Unchanged 1; the changed words are shaded darker |
| Edited sentence | The quick brown fox jumps and The quick red fox leaps | Word | Removed: brown, jumps. Added: red, leaps. Unchanged 3 |
| Spelling variant | colour and color | Character | One removed character (u), five unchanged |
| Capitalisation only | Hello World and hello world | Line, then tick Ignore case | One changed line; with Ignore case: "No differences" |
| Re-indented code | Two spaces before run(); against a tab | Line, then tick Ignore whitespace | One changed line; with Ignore whitespace: no differences |
| Re-wrapped paragraph | The same sentence split over two lines against one line | Word, with Ignore whitespace | No differences (line breaks are ignored at word level) |
| Review a long file | Two versions of a long log or script | Line, then tick "Only changed lines (+3 context)" | Unchanged runs collapse to "N unchanged lines hidden" |
| Share an edit as a patch | The config pair above, each ending with a line break, original loaded from config.txt | Download .patch | --- a/config.txt, +++ b/config.txt and one hunk, @@ -1,3 +1,3 @@ |
Line, word or character level
| Level | Compares | Suits |
|---|---|---|
| Line | Whole lines; changed lines get word-level shading | Code, configs, lists, logs |
| Word | Words, numbers and punctuation marks, ignoring spaces in the counts | Articles, contracts, copy edits |
| Character | Each character, spaces and line breaks included; accents and emoji stay whole | Typos, IDs, short strings |
Text Diff Tool Features
- Two views: side-by-side or inline. Line level adds line numbers on both sides and stacks removed and added lines inline; word and character levels show the text without line numbers, with removed parts struck through inline.
- Three levels: line, word and character, with a count of added, removed and unchanged items for the level you chose.
- Ignore case and Ignore whitespace: at line level whitespace is ignored inside lines; at word and character level it is ignored everywhere, line breaks included.
- Only changed lines: shows three lines of context around each change and folds the rest (line level only).
- File loading: text files up to 20 MB each; a file that looks binary is refused with a message.
- Exports: a plain-text report you can copy, an HTML report saved as diff-report.html, and a unified diff saved as changes.patch.
- Swap and Clear: Swap exchanges the two texts and their file names; Clear empties both.
- Line-ending tolerance: Windows and Unix line breaks are not reported as changes in the view.
Limits: the on-screen line view shows the first 5,000 rows, so use "Only changed lines" or the HTML report for longer diffs. The .patch file compares the exact texts and ignores the case and whitespace options. For a quick equality check between two files of any type, a file hash calculator compares checksums instead of content.
How to Use the Text Diff Tool
- Paste the older version into Original Text and the newer version into Modified Text, or press Load Original File and Load Modified File.
- Pick View Mode (Side-by-Side or Inline) and Diff Level (Line, Word or Character).
- Tick Ignore case or Ignore whitespace if capitalisation or spacing changes are noise, and Only changed lines to shorten a long file.
- Read the Differences panel and the Added, Removed and Unchanged counts above it.
- Press Copy Diff Report, Download HTML or Download .patch, then Clear to start again.
Who Can Use the Text Diff Tool
Developers compare two versions of a config, query or script, and can run a snippet through the SQL formatter or the JavaScript beautifier first so formatting noise does not hide the real change. Writers and editors compare drafts, and a word counter shows how much the length moved. Anyone reconciling two exports can sort lines, remove duplicate lines and then diff.
Support and operations staff compare a working and a broken configuration. If a difference turns out to be only capitalisation, the text case converter normalises it, and find and replace fixes a repeated edit across a whole file. The line counter confirms how many lines a long file has before you load it.
Text Diff FAQs
How do I compare two texts online?
Paste the original version into Original Text and the changed version into Modified Text, or use Load Original File and Load Modified File. The differences appear straight away as you type: removed text in red, added text in green, plus counts of added, removed and unchanged lines, words or characters. Use Swap if you pasted the versions in the wrong boxes.
What is the difference between line, word and character diff?
Line level compares whole lines and suits code, configuration files and lists; an edited line sits side by side with its changed words in a darker shade. Word level compares word by word, which suits prose. Character level marks each changed character, including accents and emoji, so it catches typos but is slower on long texts.
How do I ignore whitespace or letter case when comparing text?
Tick Ignore whitespace or Ignore case above the boxes. Re-indented code and doubled spaces then stop counting as changes, and "Hello" matches "hello". At word and character level, Ignore whitespace also ignores line breaks, so a re-wrapped paragraph matches the original. Both boxes still show your text exactly as you entered it.
Can I compare two files instead of pasting text?
Yes. Load Original File and Load Modified File read plain-text files such as .txt, .md, .csv, .json, .xml, .html, .css, .js and .py, up to 20 MB each. Your browser reads them locally and nothing is uploaded. Binary formats such as PDF, Word, Excel and images are refused, because they are not plain text.
What is a .patch file and how do I apply it?
The Download .patch button saves changes.patch, a unified diff in the format of "diff -u" and "git diff", with three lines of context per change. Run "patch original.txt changes.patch" to turn the original into the modified text exactly, or "git apply changes.patch" in a folder holding the original. The ignore options do not apply to a patch.
Why does the whole middle of my diff show as removed and re-added?
Texts that differ in too many places cannot be compared exactly within the browser's time and memory limits. The tool then marks the differing middle section as removed and re-added and shows a yellow notice. The result is still correct, just not the smallest. If you are on Word or Character level, switch to Line level, which has far fewer items to compare; otherwise compare the files in smaller sections.
Does Windows versus Linux line-ending style count as a difference?
No. At every level, Windows (CRLF) and Unix (LF) line breaks are treated as the same, and the tool says so when that is the only difference. Only the .patch download compares the exact texts, so it does record a change of line endings. Use it when you need to know that the line endings really changed.
Is it safe to compare confidential text in an online diff checker?
Here it is: the comparison runs in your browser with JavaScript, and loaded files are read locally, so your text is not sent to ZipConvert. You can check the Network tab in your browser's DevTools while you type. Nothing is saved when you close the tab, so confidential contracts, code and configuration files stay on your device.