Text Diff Compare Tool
Paste or upload two files side by side — instantly see additions, deletions, and changes with word-level precision
Paste two versions of any text, code, or config file and instantly see what changed — additions in green, deletions in red, with word-level or line-level precision. Supports direct paste and file uploads including PDF, JSON, JS, CSS, and Python.
Switch between word, line, or character diff modes, jump through changes one by one, or flip to side-by-side view to compare old and new in parallel columns. And everything runs in your browser. Nothing gets uploaded.
How It Works
Your text gets split into tokens — words, lines, or characters depending on the mode you pick. A Levenshtein-based algorithm figures out the minimum number of edits to turn one version into the other. And then it paints the result: green for additions, red for deletions. Takes under a second for most files. For really huge inputs (over 5,000 tokens per side) it falls back to a simpler linear comparison so your browser doesn't freeze.
Examples
Spotting a Wrong Environment in JSON
Someone pushed a config pointing to staging instead of production. Quick diff finds it.
{
"apiUrl": "https://api.prod.co",
"timeout": 3000
}{
"apiUrl": "https://api.staging.co",
"timeout": 5000
}Checking What Changed in a PR Description
A teammate rewrote the summary. Word diff shows exactly which phrases got swapped. Done in two seconds.
Fixes login bug where users get redirected to 404 after entering credentials. Updated auth redirect logic.Fixes login bug where users see 404 after submitting credentials. Refactored auth redirect logic and added tests.SQL Query Rewrite — Before and After
Rewrote a slow query with aggregation. And the line diff catches the JOIN change, the new SUM column, and the added GROUP BY. So you know exactly what shifted.
SELECT u.name, u.email, o.total
FROM users u
LEFT JOIN orders o ON u.id = o.user_id
WHERE o.created_at > '2025-01-01'
ORDER BY o.total DESC;SELECT u.name, u.email, SUM(o.total) AS total
FROM users u
INNER JOIN orders o ON u.id = o.user_id
WHERE o.created_at > '2025-01-01'
GROUP BY u.name, u.email
ORDER BY total DESC;Who Uses This
Compare config files or function rewrites when Git's diff UI is not handy or you're outside a repo.
Spot every edit between doc revisions without rereading 40 pages. Word mode is perfect for prose.
Diff API responses between staging and production to catch unexpected field changes before release.
Verify only the agreed-upon clauses changed between contract drafts. Nothing uploaded, so confidentiality stays intact.
Common Mistakes
Line diff treats each line as one big token. So if you change one word on a 300-character line, the whole thing lights up red and green. Not helpful. Switch to Word mode — it highlights just the words that actually changed.
Tabs vs. spaces, trailing whitespace, Windows vs. Unix — all of these create diffs that look like changes but mean nothing. And it's for some reason always the thing that trips people up first. Use Character mode to see what's hiding, then normalize before comparing again.
Zero differences and you're confused. Happens more than people admit. Check the file names above each panel after uploading, or hit Swap to double-check you have the right versions loaded.
Technical Details
- Processing: 100% client-side — nothing uploaded, ever
- Algorithm: Dynamic programming edit distance (Levenshtein-based)
- File Types: .txt, .pdf, .json, .js, .css, .py, .html, .xml, .csv, .yaml, .sql, and 20+ more
- PDF Support: Text extracted locally via PDF.js
- Browser Support: Chrome, Firefox, Safari, Edge
Frequently Asked Questions
How do I compare two text files online?
Paste your original text on the left and the modified version on the right, then hit Compare. You can also drag files in — it accepts .txt, .pdf, .json, .py, and dozens more. Additions show green, deletions show red. Done.
Is this diff tool safe for confidential code?
Yes. Your text never leaves the browser tab. There is no server, no storage, no account. Close the tab and everything disappears. No third-party services touch your data at any point. So confidential code, contracts, internal docs — all fine.
What is the difference between word diff and line diff?
Word diff compares individual words, so it catches small edits inside paragraphs. Line diff treats each line as one unit — better for code where a changed line usually means a changed statement. Character diff is the most granular and flags every single character that differs. But for most people, word mode is the right default.
Can I compare PDF files?
Drop a PDF into either panel and the text gets extracted automatically using PDF.js, right in your browser. It won't keep formatting or images — it pulls the raw text and compares that. Works great for contracts, reports, and other text-heavy documents.
Why does the diff show changes I did not make?
Almost always whitespace. Tabs vs. spaces, trailing spaces, or different line endings (Windows uses \r\n, Linux uses \n) all register as differences. Switch to Character mode to see them. And if they don't matter, normalize your whitespace before running the comparison again.