FREE TOOL

Text Compare: Find the Difference Between Two Texts Online

A text compare tool shows the difference between two pieces of text by marking what was added, what was removed and what stayed the same. Paste the original on the left and the changed version on the right, click Compare, and the tool highlights changes in side-by-side or unified view, down to the word or character. Everything runs in your browser.

Compare two texts now or read on to learn how to read a diff, what the similarity score really measures and when to trust the result.

Use the tool
Quick start
1Paste the original text
2Paste the changed text
3Choose a view
4Set options

Diff Editor

Paste text to compare
View:
Original Original / Left
0 lines / 0 chars
Modified Modified / Right
0 lines / 0 chars
↔

Paste text in both panels above and click Compare to see the diff.
Supports code, prose, config files, JSON, YAML, and any plain text.

`; const blob = new Blob([html], { type: 'text/html' }); const a = document.createElement('a'); a.href = URL.createObjectURL(blob); a.download = 'diff-export.html'; a.click(); showToast('HTML exported'); } function exportPatch() { if (!diffData.length) { showToast('Run compare first'); return; } let patch = '--- original\n+++ modified\n@@ -1 +1 @@\n'; for (const r of diffData) { if (r.type === 'same') patch += ' ' + (r.left ?? '') + '\n'; else if (r.type === 'del') patch += '-' + (r.left ?? '') + '\n'; else if (r.type === 'add') patch += '+' + (r.right ?? '') + '\n'; else if (r.type === 'mod') { patch += '-' + (r.left ?? '') + '\n'; patch += '+' + (r.right ?? '') + '\n'; } } const blob = new Blob([patch], { type: 'text/plain' }); const a = document.createElement('a'); a.href = URL.createObjectURL(blob); a.download = 'diff.patch'; a.click(); showToast('Patch exported'); } function copyDiff() { if (!diffData.length) { showToast('Run compare first'); return; } let text = ''; for (const r of diffData) { if (r.type === 'same') text += ' ' + (r.left ?? '') + '\n'; else if (r.type === 'del') text += '- ' + (r.left ?? '') + '\n'; else if (r.type === 'add') text += '+ ' + (r.right ?? '') + '\n'; else if (r.type === 'mod') { text += '- ' + (r.left ?? '') + '\n'; text += '+ ' + (r.right ?? '') + '\n'; } } navigator.clipboard.writeText(text).then(() => showToast('Diff copied to clipboard')); } /* ================================================================ TOAST ================================================================ */ function showToast(msg) { const t = document.getElementById('wbToast'); t.textContent = msg; t.classList.add('show'); setTimeout(() => t.classList.remove('show'), 2200); } /* ================================================================ FAQ ================================================================ */ (function() { document.querySelectorAll('#wbFaq .wb-faq-item').forEach(function(item) { item.querySelector('.wb-faq-q').addEventListener('click', function() { const open = item.classList.contains('open'); document.querySelectorAll('#wbFaq .wb-faq-item').forEach(i => i.classList.remove('open')); if (!open) item.classList.add('open'); }); }); })();
Quick answer:: Input:
an original text and a modified text. Output: added, removed and unchanged lines, with optional word-level and character-level highlights. Views: side by side or unified (+ and - lines). Similarity score: unchanged lines divided by the larger line count, as a percentage.

What Is a Text Compare Tool?

A text compare tool, also called a diff checker, text diff or text difference checker, compares two versions of a text and shows exactly what changed. It lists lines that were added, lines that were removed and lines that stayed the same.

The word "diff" comes from the Unix diff command, which dates from the early 1970s and was included in Unix in 1974. Today the same idea powers code review on GitHub, document tracking and configuration checks.

Developers use it to review code. Writers use it to compare drafts. QA engineers use it to verify edits. System administrators use it to compare configuration files between environments.

How to Use the Text Compare Tool

  1. 1
    STEP 1 Paste the original text into the left panel, labelled Original. You can also use Upload to load a text file.
  2. 2
    STEP 2 Paste the changed text into the right panel, labelled Modified.
  3. 3
    STEP 3 Choose a view: Side by Side or Unified.
  4. 4
    STEP 4 Set options: Ignore case, Ignore whitespace, Ignore blank lines, Word-level diff, Char-level diff and Fold unchanged.
  5. 5
    STEP 5 Click Compare. The differences appear below with colour coding and a similarity score.
  6. 6
    STEP 6 Move through the changes and export the diff as HTML or patch format if you need to share it.
  7. 7
    STEP 7 Use Swap to flip the two sides, or Clear All to start again.
Expert tip

Use the Load Code Example, Load Prose Example or Load Config Example buttons first to see how additions, removals and word-level highlights look. Then paste your own text.

Use the tool

How to Read the Results

What you seeMeaningTypical colour
Added lineExists only in the modified textGreen
Removed lineExists only in the original textRed
Unchanged lineSame in both textsNo highlight (can be folded)
Changed line with word highlightsLine differs, with the changed words marked inside itRed strikethrough for the old word, green for the new word
Character highlightsExact letters that differ inside a changed wordUseful for typos and punctuation

Turn on Fold unchanged for long texts so you only see the changed areas and a little context around them.

Side by Side or Unified View?

FeatureSide by sideUnified
LayoutTwo columns: original left, modified rightOne column with + and - prefixes
Best forSmall to medium changes and visual comparisonLarge files, patches and Git-style output
AlignmentMatching lines sit next to each otherRemoved lines appear before added lines
Common inIDEs and code review tools such as VS Code and GitHubGit patch files and email patches
SpaceNeeds a wider screenCompact

On a phone or narrow window, the unified view is easier to read.

Word-Level and Character-Level Diff

  • Line-level only: a whole line is marked changed even when one word differs. This can bury a small edit in a long paragraph.
  • Word-level diff: inside a changed line, only the added or removed words are highlighted. This is the best setting for prose.
  • Character-level diff: inside a changed word, the exact characters that differ are marked. This catches typos, a changed digit or a missing punctuation mark.

Ignore Case, Whitespace and Blank Lines

The three ignore options remove noise. Ignore case treats Apple and apple as equal. Ignore whitespace skips differences in spaces and tabs, which helps when code was re-indented. Ignore blank lines skips empty lines that were added or removed. Turn them on when formatting changes hide the real edits. Turn them off when you need to find those formatting changes, for example in a YAML file where indentation matters.

What Is the Myers Diff Algorithm?

The Myers diff algorithm was published by Eugene Myers in 1986 in the paper "An O(ND) Difference Algorithm and Its Variations". Git and GNU diff use it as their standard algorithm, and so do many diff tools, including the live tool. It finds the shortest edit script, meaning the smallest number of insertions and deletions needed to turn one text into the other.

Its running time is O(ND), where N is the combined length of the two sequences and D is the number of differences. When the texts are similar, D is small, so the tool stays fast even for big files. In plain terms: the fewer changes there are, the faster the comparison.

A shortest edit script is not always the one a human finds clearest. Some tools offer other strategies, such as patience diff, that favour more readable output. Myers aims for the smallest set of edits.

What Does the Similarity Score Mean?

The similarity score is a percentage from 0 to 100 shown after you compare. The live tool calculates it as unchanged lines divided by the larger of the two line counts, multiplied by 100. A score of 100% means the texts are identical. A score of 0% means they share no common lines.

How to read it correctly

The score counts lines, not words or characters.

If a text is one long line, any change makes that line different, so a single edited word can give 0%.

If a document has 100 lines and 90 are unchanged, the score is 90%, even if the other 10 lines were completely rewritten.

It is a quick measure of how much a document changed. It is not a plagiarism, quality or meaning score.

For prose, put each sentence on its own line before comparing so the score reflects sentence-level changes more fairly.

Text Compare Use Cases

Code review

Compare a function before and after refactoring without setting up Git.

Document revisions

See what changed between a first draft and a final contract, specification or article.

Configuration management

Compare .env, YAML or JSON settings between staging and production.

Content QA

Check an editor's changes against the brief before publishing.

Data checks

Compare query output from two runs. Tidy JSON first with the JSON formatter so both sides use the same layout.

Translation checks

Compare structure and line count between a source and a translated document.

Log analysis

Find new error patterns between two deployments.

Text Compare vs Other Ways to Diff

MethodGood atTrade-off
This online toolQuick checks with no setup, word and character highlightsPlain text only, one pair at a time
Word or Google Docs compareTracked changes in formatted documentsNeeds a word processor and both files in that format
VS Code compareComparing files in a projectNeeds the editor installed
git diffVersion-controlled codeNeeds a repository and the command line

Common Mistakes

  • Reading the similarity score as quality or plagiarism. It is a line-based percentage.
  • Comparing pasted text with different line wrapping. One side wrapped at 80 characters and the other not will look entirely different.
  • Leaving ignore options on by mistake. Ignored whitespace can hide a real change in a YAML or Python file.
  • Swapping sides without noticing. Added and removed are reversed, so check which text is Original.
  • Comparing formatted documents. Copy plain text first, because bold, tables and images are not compared.
  • Expecting moved blocks to be recognised. A paragraph moved to a new place shows as a removal and an addition.

Limits of This Tool

  • It compares plain text. Formatting, images and comments inside Word or PDF files are not compared. Upload accepts text files. Confirm the allowed types on the live tool.
  • The diff is by lines, with word and character detail added inside changed lines.
  • The similarity score is only a line-based percentage.
  • It compares two texts at a time, not three-way merges.
  • A diff shows what changed, not whether the change is correct.

Privacy

The live page states that all diff processing runs in your browser and that neither panel's content is sent to a server, logged or stored. That makes it suitable for private code, contracts and documents. As a habit, remove API keys and passwords from text before you paste it into any online tool, even one that runs locally.

Open the tool

Frequently Asked Questions

What is a text compare tool?

It compares two versions of a text and highlights what was added, removed or left unchanged. It is also called a diff checker or text difference checker.

How do I compare two texts online?

Paste the original text on the left and the modified text on the right, then click Compare. The differences appear with colours and a similarity score. Use Word-level diff to mark changed words inside lines.

What is the Myers diff algorithm?

It is the algorithm published by Eugene Myers in 1986 that finds the shortest set of insertions and deletions turning one text into another. Git, GNU diff and this tool use it.

What does the similarity score mean?

It is unchanged lines divided by the larger line count of the two texts, times 100. A score of 100% means identical text and 0% means no common lines. It counts lines, not words.

Why is my similarity score 0% when I only changed one word?

Because the score is line-based. If your text is a single long line, changing one word changes the whole line, so no lines match. Put each sentence on its own line to get a more useful score.

What is the difference between side by side and unified view?

Side by side shows the original on the left and the modified text on the right. Unified shows one column with minus lines for removals and plus lines for additions, as in a Git patch.

Can I ignore whitespace or case?

Yes. Use the Ignore case, Ignore whitespace and Ignore blank lines options to hide those differences and focus on real edits.

Can I compare code?

Yes. It works with code, configuration files, JSON, YAML and any plain text, and the Char-level diff option helps catch small changes in variable names.

Is my text sent to a server?

No. The live page states the comparison runs in your browser and nothing is sent to a server, logged or stored.

Can I save or share the result?

Yes. You can export the diff as HTML or in patch format, according to the live page. Compare your texts Need to check how long your two versions are? Use the word counter. To clean a list before comparing, use the duplicate word remover.

Ready to try the Text Compare?

Free to use. Open the tool and get your result in seconds.

Use the tool
For contributors
Got something worth sharing? Write for us.

Original, well researched guides are always welcome here.

  1. 1Read the guidelines
  2. 2Send us your pitch
  3. 3Our editors review it