📃 Text Diff
Compare text side by side — highlights every change
✓ Free Forever · ✓ No Signup · ✓ No Upload · ✓ Works Offline
🔒 Your text never leaves your device. All processing happens locally in your browser using JavaScript diff algorithm. No upload, no server, no tracking.
Features
- Three Diff Modes — Compare text by characters, words, or lines — choose the granularity that fits your needs.
- Color-Coded Output — Additions are marked green, deletions red and struck through; unchanged text stays plain.
- Change Statistics — See how many characters, words or lines were added, removed or left unchanged — counted in the unit of the mode you picked.
- Swap, Clear & Open Files — Swap original and modified text, clear both fields, or open a text file into either side. Open or drop two files at once and they fill both sides.
How It Works
- Enter original text — Paste the original version of your text in the left panel.
- Enter modified text — Paste the modified version in the right panel.
- Review differences — See the two texts lined up side by side (or inline), every change highlighted. Switch between character, word and line modes.
Use Cases
- Compare two drafts of an article or document
- Spot changes between code versions without Git
- Verify edits in contracts or legal documents
- Compare API responses or configuration files
Frequently Asked Questions
Which diff mode should I use?
Character mode shows the most detail. Word mode is best for prose and natural language. Line mode is ideal for code and structured text.
Can I compare large texts?
Yes. The comparison runs in the background, so the page stays usable while it works. Text with a few edits takes a fraction of a second; two texts that differ almost everywhere can take about five seconds. Passages that still can’t be compared in detail by then are marked as whole lines, and the page says so.
Does it notice extra spaces and line breaks?
Yes, in all three modes: each side is shown exactly as it was written, and an added or removed space, tab or line break is marked. Words doesn’t count spacing in its numbers, and if spacing is the only difference the page says so. In Lines, one different space makes the line count as changed, unless you choose to ignore spaces.
How are the two sides lined up?
Line by line: unchanged lines sit next to each other, and a changed line faces the line it became, with the changed words or characters highlighted inside it. Long runs of unchanged lines are folded away — click to show them.
Can I ignore upper/lower case or spaces?
Yes. Under Ignore, switch on Upper/lower case, Spaces or both. Each side still shows its own text; only the differences you chose are left unmarked. If nothing else differs, the page says so.
Can I save the differences as a patch?
Yes. Copy as patch and Download .diff give a unified diff, the format diff -u prints. Save the original text as original.txt and run patch original.txt changes.diff in a terminal to turn it into the modified text. The patch always covers every difference, including the ones you chose to ignore on screen.
Notes from Milo 🐨
I pasted two versions of a Python script in here and the left column showed indentation the original never had: Words mode was quietly borrowing the new text’s spacing. Both sides now show exactly what you pasted, and every changed space, tab or line break is marked. Words in Russian, Hindi and other scripts are no longer cut in half, an emoji counts as one character, and characters you can’t see get a label. Also new: ignore upper/lower case or spaces, buttons to jump from change to change, two files at once, a patch you can copy or download, and two long files that differ on every line are now compared instead of refused.
Open file used to read everything as UTF-8, so comparing two files saved by an older Windows program showed "�" where every accent or Chinese character should be — and two files that differed only there looked the same. Files are now read in their own encoding, and the page says which one when it had to guess, with a list to pick another.
The page always promised a side-by-side comparison, but the result was one long inline stream — and worse, two texts that differed only by a double space were declared "identical", because Words mode ignores spacing. Now the two texts are lined up row by row, each changed line facing the line it became, with the changed words marked inside it; long stretches that didn't change fold away. If the only difference is spaces, tabs or line breaks, the page says so and shows where, instead of calling them identical. In Lines mode a changed last line no longer sticks to its replacement, and a deleted blank line actually shows. The numbers now say what they count (characters, words or lines), and you can open a text file straight into either side. Inline view is one click away if you prefer it.
I pasted two long, quite different documents in here, switched to Characters, and the whole tab locked up — every keystroke after that took seconds, because the comparison ran in the page itself and started over each time you typed. It now runs in the background: the page stays responsive however much you paste, a long comparison waits until you stop typing, and if two texts are so different that a character-by-character comparison would take forever, it says so and suggests Lines instead of hanging. Smaller things: two identical texts now get a plain "identical" instead of a page of unmarked text, a file saved on Windows no longer differs from the same text typed in on every single line, the boxes stack on a phone instead of squeezing side by side, and the selected mode button is actually readable.
Related Tools
- 🔢 Word Counter — Analyze text — word count, characters, reading time, and top words
- 🧹 Remove Duplicates — Remove duplicate lines from text with sorting and trimming options
- 🔍 Regex Tester — Test and debug regular expressions with real-time matching
💬 Bug, idea, or just to say hi? Tell Milo 🐨 · [email protected]