Skip to main content
L
Loopaloo
Buy Us a Coffee
All ToolsImage ProcessingAudio ProcessingVideo ProcessingDocument & TextPDF ToolsCSV & Data AnalysisConverters & EncodersWeb ToolsMath & ScienceGames
Guides & BlogAboutContact
Buy Us a Coffee
L
Loopaloo

Free online tools for developers, designers, and content creators. Your files are processed in your browser and are never uploaded - no accounts required. A few network utilities (like What's My IP and Currency Converter) call public APIs to do their job and say so on their pages.

support@loopaloo.com

Tool Categories

  • Image Tools
  • Audio Tools
  • Video Tools
  • Document & Text
  • PDF Tools
  • CSV & Data
  • Converters
  • Web Tools
  • Math & Science
  • Games

Company

  • About Us
  • Contact
  • Blog
  • FAQ

Legal

  • Privacy Policy
  • Terms of Service
  • Disclaimer

Support

Buy Us a Coffee

© 2026 Loopaloo. All rights reserved. Built with privacy in mind.

Privacy|Terms|Disclaimer
  1. Home
  2. Document & Text
  3. Text Diff & Compare Tool
Add to favorites

Text Diff & Compare Tool

Compare two texts and see every added, removed and changed line, with word or character highlights, side-by-side or unified views, and a .patch export.

Text processed locallyMore document & textJump to full guide

Initializing in your browser…

You might also like

Image Text Extractor (OCR)

Copy the text out of a photo, scan or screenshot in 18 languages. Small text is enlarged first, unsure words are marked, and the result can be tidied and exported.

Text Case Converter

Convert text to 17 case styles at once, including Title Case (Chicago, AP or APA), Sentence case, camelCase, snake_case and URL slugs, with one-click copy.

Text Statistics Analyzer

Check how easy your text is to read: Flesch Reading Ease, an average grade level from five formulas, and the long sentences worth splitting.

Text Diff & Compare Tool: a worked example

A teammate sends back an "updated" database config and you need to see exactly what they changed before deploying it.

Original and changed

Original:                 Changed:
host = db.internal        host = db.internal
port = 5432               port = 5432
timeout = 30              timeout = 60
pool_size = 10            pool_size = 10
log_level = info          log_level = info
                          retries = 3
What Text Diff & Compare Tool produces

Summary and unified diff

+1 added  0 removed  1 changed  4 unchanged  67% similar

--- original
+++ modified
@@ -1,5 +1,6 @@
 host = db.internal
 port = 5432
-timeout = 30
+timeout = 60
 pool_size = 10
 log_level = info
+retries = 3

Two things changed: the timeout doubled and a retries setting was added. With word highlighting on, only 30 and 60 are marked inside the timeout line, so the change cannot be missed. The similarity is 4 matching lines out of 6 in the longer file, which rounds to 67%. The patch shown is exactly what Copy patch and Download .patch produce, and it applies cleanly to the original file with patch or git apply.

What is Text Diff & Compare Tool?

Paste two versions of a text and see exactly what changed, line by line, with the changed words or characters highlighted inside each line. Switch between side-by-side, unified and inline views, and copy or download the result as a standard .patch file.

How it works

Comparing two versions by eye is slow and unreliable, especially when the change is a single digit in a config file or one reworded sentence in a contract. This tool lines the two texts up, marks every added, removed and changed line, and highlights the exact words or characters that differ inside a changed line. The comparison updates as you type or paste, so there is no button to press.

How lines are matched. The comparison uses the Myers algorithm, the same approach behind git diff, which finds the smallest set of additions and removals that turns the first text into the second. Long files are handled quickly: tens of thousands of lines compare in a fraction of a second. A removed line followed by an added line is shown as a changed line, and the words that differ are highlighted. Every line keeps its real line number from its own file, and a check under the counts confirms that every line of both texts is accounted for.

Three views. Side by side puts the original on the left and the changed text on the right, with matching lines aligned on the same row and empty space where a line exists on only one side. Unified shows one column with minus and plus markers and both sets of line numbers, the familiar layout from code review. Inline reads like tracked changes: unchanged text once, with deletions struck through and additions highlighted in place.

What counts as the same line. Comparison options let you ignore differences that do not matter for your task: spacing at line ends or all spacing changes (useful after re-indenting code), letter case, blank lines, Windows versus Unix line endings, and the two ways Unicode can store an accented letter. These options change only what is compared. The text you see is always exactly what you pasted. When a block of lines has moved rather than changed, the tool labels both ends of the move so a reordered paragraph is not mistaken for new content.

Exporting. Copy patch or Download .patch gives a standard unified diff with three lines of context, the format that patch, git apply and most code review tools read. The export always covers the whole comparison, even when a very large result is trimmed on screen. Both texts stay in your browser; nothing is uploaded, so internal documents and configuration files remain private.

How to use

  1. 1Paste the original text on the left and the changed text on the right, or use Open file on either side. Try an example loads two versions of a short script.
  2. 2Read the summary: lines added, removed, changed and unchanged, plus a similarity percentage.
  3. 3Pick a view: Side by side, Unified or Inline. Set Highlight inside lines to Words or Characters to see the exact change within a line.
  4. 4Open Comparison options to ignore spacing, case, blank lines or line-ending differences if they are not relevant.
  5. 5Use Copy patch or Download .patch to share or apply the changes.

Key features

  • Live comparison as you type or paste, with no compare button
  • Side-by-side view with aligned rows, plus unified and inline views
  • Word-level or character-level highlighting inside changed lines, safe for emoji and accents
  • Original line numbers kept for both files, even when blank lines are ignored
  • Options to ignore whitespace, case, blank lines, CRLF line endings and accent encoding
  • Moved blocks labelled at both ends
  • Counts of added, removed, changed and unchanged lines with a similarity score
  • Standard unified diff output to copy or download as .patch
  • Fast on large files, with the on-screen view capped at 3,000 rows and the export complete
  • Runs locally; nothing is uploaded

When to reach for this

  • Reviewing a configuration change

    See exactly which settings a colleague changed in a config or environment file before deploying it.

  • Comparing document drafts

    Check what an editor or client changed between two versions of an article, policy or contract, with the changed words highlighted.

  • Checking code without a repository

    Compare two snippets from chat, email or a ticket and produce a patch file that can be applied with patch or git apply.

  • Spotting invisible differences

    Find out why two lines that look identical do not match: a trailing space, a Windows line ending or a differently encoded accent.

Tips & best practices

  • Use Characters highlighting to find single-character changes such as a changed digit, a swapped quote mark or a missing comma.
  • Swap the two sides to read the change the other way round, for example to write a reverse patch.
  • For prose, the Inline view with word highlighting reads most naturally; for code, Side by side or Unified is easier to follow.
  • If two lines look identical but are marked as changed, try "Treat accent spellings as equal" and the whitespace options to find the invisible difference.

Examples

  • A changed timeout

    Original "timeout = 30" and changed "timeout = 60" with a new "retries = 3" line at the end gives 1 changed line, 1 added line and 4 unchanged lines. With word highlighting, only "30" and "60" are marked.

  • Re-indented code

    After code is re-indented, every line differs. Set Whitespace to "Ignore all spacing changes" and only the lines whose content changed remain highlighted, while the view still shows the new indentation.

  • A CSV saved on Windows

    A CSV saved with CRLF line endings compared with the same data saved with LF matches line for line by default. Turn off "Ignore line endings" and the lines that end differently are marked as changed, which explains why another tool reported every line as different.

Frequently asked questions

What is the difference between side-by-side, unified and inline views?

Side by side shows the two texts in two aligned columns. Unified shows one column where removed lines start with a minus and added lines with a plus, as in git diff. Inline shows the text once with deletions struck through and additions highlighted, similar to tracked changes in a word processor.

Can I apply the downloaded patch?

Yes. The .patch file is a standard unified diff with three lines of context and the file names "original" and "modified". Save the original text to a file, then apply the patch with patch or git apply, giving the file name if it differs.

Why does every line show as changed?

The usual causes are indentation, trailing spaces or different line endings. Open Comparison options and choose to ignore spacing changes. Line-ending differences are ignored by default; if you turned that off, turn it back on.

How is the similarity percentage calculated?

It is the number of matching lines divided by the number of lines in the longer text. Hover over it to see the other common definition, twice the matches divided by the total lines of both texts, which gives a slightly higher figure when one text is much shorter.

Does it detect moved paragraphs?

Yes, with "Point out moved lines" on (the default). A line diff can only record a move as a removal in one place and an addition in another, so both halves are labelled as moved. The counts still include them as removed and added.

Is there a size limit?

There is no fixed limit. Large files compare quickly; the on-screen view shows the first 3,000 rows to keep the page responsive, while the counts, Copy patch and Download .patch cover the entire comparison.

Are my texts uploaded?

No. The comparison runs in your browser. The share link only stores your view and comparison settings, never the texts.

Related tools and how they differ

  • CSV File Comparator: Compares two CSV files by row and column, which suits tabular data better than a line diff.
  • JSON Formatter & Validator: Format both JSON documents the same way first so the diff shows real changes instead of layout.

Private by design

Your text is processed locally in the browser. Nothing you paste or open is transmitted or logged.