Free tool
Free text diff checker
This free text diff tool lets you compare two texts and instantly see what changed — line by line and word by word. Paste or upload two versions, pick side-by-side or unified view, and spot every addition, deletion, and edit. It runs entirely in your browser, so nothing you paste is ever uploaded anywhere.
Text diff checker
Compare two blocks of text line by line and word by word — see exactly what changed, entirely in your browser.
0 lines
0 lines
Comparison runs entirely in your browser using a line- and word-level diff algorithm. Your text is never uploaded to a server, so this works offline and is safe for contracts, source code, and other sensitive content.
How to use this text diff checker
- Add your original text. Paste it into the left-hand box, or click Upload .txt to load it from a file.
- Add your changed text. Paste the newer or edited version into the right-hand box.
- Read the comparison. The diff updates live as you type — no button to click. Removed lines are tinted red, added lines are tinted green, and changed word ranges are highlighted more strongly inside each line.
- Switch views if needed. Use Side-by-side to see both versions in parallel columns, or Unified for a single-column view with +/− markers, closer to a classic patch file.
- Fine-tune the comparison. Turn on Ignore case or Ignore whitespace if you only care about real content changes, not formatting noise.
- Export the result. Use Copy unified diff to grab a plain-text diff you can paste into a ticket, email, or code review comment.
What is a text diff, and how does it work?
A diff (short for “difference”) is a comparison between two versions of a document that highlights exactly what was added, removed, or changed between them. Instead of re-reading both documents end to end and trying to spot changes by eye, a diff tool does the comparison algorithmically and shows you only what's different.
Under the hood, most diff tools — including this one — use some variant of the longest common subsequence (LCS) algorithm. The tool first breaks each text into lines, then finds the longest sequence of lines that appears, in order, in both versions. Any line that isn't part of that shared sequence is treated as either removed (it was in the original but not the changed version) or added (it's new in the changed version). When a removed line and an added line sit next to each other, that usually means a line was edited rather than deleted and replaced, so this tool pairs them up and runs a second, finer-grained word-level diff on just that pair — which is why you'll see individual words highlighted inside an otherwise unchanged line, not just the whole line marked red or green.
This two-level approach (line diff, then word diff on changed-line pairs) is exactly how tools like Git, GitHub's pull request view, and desktop diff utilities such as Beyond Compare or WinMerge work. It gives you the best of both: a quick line-level overview of how much changed, and a precise, word-level view of exactly what changed within each edited line.
Reading a diff: side-by-side vs. unified view
There are two common ways to display a diff, and this tool supports both:
| View | Layout | Best for |
|---|---|---|
| Side-by-side | Two columns — original on the left, changed on the right, with line numbers on both sides. | Reviewing full documents like contracts or essays, where you want to see both full versions in context. |
| Unified | One column, with a leading + or − marker on each changed line. | Compact review of code and config files, and for copying a patch-style diff elsewhere. |
In both views, the color coding is the same: red means “this was in the original but is gone or changed,” and green means “this is new or changed in the updated version.” A darker, stronger highlight inside a line marks the exact words that changed, while the lighter background around it shows you which whole line the change belongs to.
Common use cases for a text diff tool
- Contracts & legal documents. Compare a redlined agreement against the original to confirm exactly which clauses, dates, or dollar amounts changed before you sign — without reading every paragraph twice.
- Code & config files. Paste two versions of a script, config, or log file to spot a one-character typo, a changed environment variable, or an accidental formatting change — useful when you don't have (or don't want to set up) a full git diff.
- Essays & written content. See what an editor or reviewer changed in your draft, compare two revisions of a blog post, or check what an AI rewrite altered versus your original wording.
- Configs & structured text. Compare JSON, YAML, CSV, or `.env`-style files line by line to catch a missing key, a reordered value, or a silently changed default.
- Emails & templates. Confirm a mail-merge template or email draft matches an approved version exactly, with no accidental edits slipping through.
- Translations & localization. Compare two translated strings or locale files to check nothing was dropped or duplicated during an update.
Comparing contracts: a closer look
Contract redlines are one of the most common reasons people search for a text diff tool, and also one of the easiest ways to miss something important if you're relying on your eyes alone. A contract revision often looks nearly identical to the original at a glance — the structure, headings, and most paragraphs are untouched — which is exactly what makes the one changed number, date, or party name so easy to skim past.
To compare a contract with this tool, copy the text of the original agreement into the left box and the revised or counter-signed version into the right box. Formatting from PDFs and Word documents sometimes introduces extra line breaks or spacing when you copy-paste, so turning on Ignore whitespace first is usually a good idea — it prevents the diff from flagging every paragraph as “changed” just because a line wrapped differently. Once the noise is filtered out, what's left in red and green is the actual substance: a changed payment term, an added clause, a different notice period, or a renegotiated liability cap. Because the tool pairs up edited lines and runs a word-level diff inside them, a change like “30 days” becoming “60 days” is highlighted at the word level, not just flagged as “this whole paragraph changed,” so you can see precisely what moved.
The same approach works for any legal or compliance document where two versions need to be reconciled — NDAs, SOWs, lease agreements, terms of service, or internal policies — anywhere a small wording change can have outsized consequences.
Comparing code and config: a closer look
When you have two snapshots of a file but no git history to fall back on — a config pulled from a backup, a script shared over Slack, or an environment file from a teammate — pasting both versions here gives you a quick, disposable diff without installing anything or setting up a repository. This is especially handy for one-off comparisons: checking what changed between two exported .env files, spotting a typo in a copied API key, or confirming a JSON payload matches an expected shape after a refactor.
For code and config specifically, leave Ignore case off — case matters in most languages and key names — but consider Ignore whitespace if you're comparing output that went through different formatters or indentation styles and you only care about logical changes, not re-indentation. The Unified view is usually the more natural choice here, since it mirrors the +/− format you already know from git diff and patch files, and the Copy unified diff button lets you paste that exact format into a pull request comment, a bug report, or a support ticket.
Tips for getting a cleaner diff
- Strip formatting artifacts first. Text copied from a PDF or Word doc can carry hidden line breaks, non-breaking spaces, or smart quotes that create false differences. Turning on Ignore whitespace handles most spacing issues; for anything more unusual, running the text through the text cleaner first will normalize it before you diff.
- Compare like with like. If one version has Windows-style line endings and the other has Unix-style, this tool normalizes both automatically, but it's still worth double-checking that you copied a complete version on each side — a partially pasted document will show a huge block of “removed” or “added” lines that isn't a real change.
- Use unified view for large files. Side-by-side is easier to read for shorter documents, but once a file runs into the thousands of lines, the unified view's single column is faster to scroll through and easier to copy out as a patch.
- Watch the summary bar. The “+N added · −M removed” count at the top of the result gives you an instant sense of how big the change is before you read a single line — useful for deciding whether a “small tweak” someone mentioned is really small.
- Re-run after fixing. If you're iterating on a document — editing a draft, patching a config — keep this tab open and re-paste the latest version. The comparison is live, so there's no need to click a button each time.
Text diff vs. manual proofreading
Reading two documents side by side and trying to spot every difference by eye is slow and error-prone — the human brain is good at skimming for meaning, which is exactly what makes it bad at catching a single swapped digit in a price or a missing “not” that flips a sentence's meaning. A diff tool doesn't skim: it compares every character, so a one-word change in a 10-page contract shows up just as clearly as a rewritten paragraph.
That said, a diff tool tells you what changed, not whether the change is good or bad — that judgment is still yours. Use the diff to narrow a large document down to the handful of lines that actually changed, then read those specific lines carefully.
Ignore case and ignore whitespace: when to use them
By default, this tool treats Hello and hello as different, and a line with two spaces between words as different from one with one space. That's the correct default for code and anything where formatting matters. But two toggles let you filter out noise you don't care about:
- Ignore case treats
Reportandreportas identical. Turn this on when comparing prose where capitalization inconsistencies aren't meaningful changes. - Ignore whitespace trims leading/trailing spaces and collapses multiple spaces or tabs into one before comparing. Turn this on when comparing text that went through different editors or copy-paste sources that may have reformatted spacing without changing the actual words.
Both toggles only affect how lines are compared — the original text is always what's displayed in the diff, so you never lose sight of the real formatting.
Is this text diff checker private and safe for sensitive documents?
Yes. Every comparison happens locally in your browser using JavaScript — your text is never uploaded to a server, logged, or stored anywhere. That makes it safe to paste in contracts, source code, internal notes, or anything else you wouldn't want leaving your machine. It also means the tool works offline once the page has loaded, and there's no file size limit beyond what your browser can comfortably handle (this tool pauses automatically above roughly 20,000 lines per side to keep things responsive).
Who uses a text diff checker?
- Lawyers & contract managers compare redlines and revised agreements to confirm exactly what changed before signing.
- Developers diff config files, logs, or code snippets when they don't have the original files in version control.
- Writers & editors compare drafts to see what an editor, collaborator, or AI tool changed.
- Students & researchers check citation lists, data tables, or revised sections between paper drafts.
- Support & QA teams compare expected vs. actual output when debugging a report or export.
- Translators verify localized strings match the source structure with nothing missing or duplicated.
Need to check the raw size of a document before or after editing? Pair this with the character counter, or run messy text through the text cleaner first to strip stray formatting before comparing.
Frequently asked questions
- What is a text diff checker?
- A text diff checker compares two blocks of text and highlights exactly what was added, removed, or changed between them — line by line and, for edited lines, word by word — so you don't have to spot changes by eye.
- How do I compare two texts online for free?
- Paste your original text into the left box and your changed text into the right box on this page. The comparison updates live: removed content is tinted red, added content is tinted green, and changed words are highlighted more strongly within each line.
- Is this diff checker free and unlimited?
- Yes. There's no sign-up, no watermark, and no artificial limit on how many times you can compare text. The only cap is a soft limit of about 20,000 lines per side to keep your browser responsive on very large files.
- Is my text uploaded to a server?
- No. The comparison runs entirely in your browser using JavaScript. Your text is never sent over the network, logged, or stored, which makes this safe for contracts, source code, and other confidential content.
- What's the difference between side-by-side and unified diff view?
- Side-by-side shows both full versions in two columns with independent line numbers, which is easiest for reading whole documents. Unified shows a single column with +/− markers on changed lines, which is more compact and closer to a patch file you'd see in code review.
- Can I ignore whitespace or case differences?
- Yes. Turn on "Ignore whitespace" to trim and collapse spaces before comparing, or "Ignore case" to treat uppercase and lowercase as identical. Both options only affect the comparison — the original text is still what's displayed.