X Xerobit

Text Compare — Free Online Diff Checker

Paste two texts and instantly see every difference highlighted. Line, word, or character granularity. Added lines in green, removed in red. Ignore whitespace and case. LCS-based diff. Runs entirely in your browser — nothing is uploaded.

Diff view
 
Paste text in both sides.

What is a text compare tool?

A text compare tool (also called a diff checker or text diff tool) takes two blocks of text — an original and a modified version — and shows exactly what changed between them. Every addition is highlighted in green, every deletion in red, and unchanged content stays neutral. The result is a clear, scannable view of the differences without having to read both versions line by line.

This tool runs the comparison entirely in your browser using a Longest Common Subsequence (LCS) algorithm. No text leaves your machine. It works on any plain text: code, prose, config files, SQL, emails, legal documents, and more.

How to use the text diff tool

  1. Paste your original text into the left panel (labeled "Original").
  2. Paste the modified text into the right panel (labeled "Modified").
  3. Choose a diff mode — Line, Word, or Character — depending on how granular you need the comparison.
  4. Toggle options if needed: "Ignore whitespace" normalises spacing differences; "Ignore case" treats upper and lower case as equal.
  5. Read the result below the inputs. Green highlights are additions, red are deletions. A summary shows total added and removed token counts.

To start over, clear both panels and paste new content. The comparison updates in real time as you type or paste.

Text compare — copy and paste

The fastest way to use this text compare tool is a direct copy-and-paste workflow. Here is a typical example comparing two versions of a configuration value:

Original text (paste into left panel):

MAX_RETRIES=3
TIMEOUT=30
LOG_LEVEL=info
DATABASE_URL=postgres://prod-db:5432/app

Modified text (paste into right panel):

MAX_RETRIES=5
TIMEOUT=30
LOG_LEVEL=debug
DATABASE_URL=postgres://staging-db:5432/app

The diff output will immediately show three changed lines (MAX_RETRIES, LOG_LEVEL, and DATABASE_URL) while leaving TIMEOUT=30 unmarked as unchanged. This makes it trivial to audit environment-file drift between staging and production.

The same copy-and-paste approach works for any text: paste two contract drafts to find changed clauses, paste two JSON configs to spot a missing key, or paste two SQL migration scripts to catch an unintended change.

Line, word, or character granularity?

Pick the mode based on how similar your two texts are and what level of detail you need:

Common use cases

Developers, writers, and teams use online text comparison tools daily for tasks like:

How the diff algorithm works

This tool uses a Longest Common Subsequence (LCS)-based diff. It builds a dynamic-programming table of LCS lengths between the two inputs, then walks back to emit a sequence of keep/add/remove operations. This is the same approach as the classic Hunt–McIlroy diff that powers diff -u on Unix. It runs in O(n×m) time and memory, which is why the tool caps input size at ~2 million cells.

For very large inputs (whole-file diffs of 100 KB+), professional tools use the Myers variant which runs in O(ND) time (D = edit distance). For typical browser-based use on a few kilobytes of text, the straight LCS approach is clearer and fast enough.

Ignore whitespace and ignore case options

For structured JSON, use the JSON Diff tool

If you are comparing JSON, use the JSON Diff tool instead. It performs a structural diff — it ignores key order and whitespace formatting and compares the data structure directly. This text compare tool treats the raw characters, so reformatted JSON will show hundreds of false differences. The JSON Diff tool will show only meaningful data changes.

For other tools in the same pillar, see XML Formatter for cleaning up XML before comparing, and Word Counter for analysing the size of each text before diffing.

Frequently asked questions

Is this text compare tool free?

Yes, completely free with no sign-up required. Paste text and compare instantly. There are no usage limits because the comparison runs in your browser rather than on a server.

Is my text sent to a server?

No. The entire comparison runs in JavaScript in your browser. Your text never leaves your device. This makes the tool safe for sensitive content like contracts, credentials, and internal documents.

Why does character diff show the whole word changed?

It should not — character diff works at the individual-character level. If you see whole words marked, check that you have selected "Character" mode (not Word or Line mode) from the granularity selector.

Why is it slow on large inputs?

LCS diff is O(n×m). Character-level diff on two 1,000-character strings computes 1 million cells — fast. Two 10,000-character strings produce 100 million cells — that gets slow and memory-intensive. For large inputs, switch to Word or Line granularity, which produces far fewer tokens and runs much faster.

Does this handle Unicode and emoji correctly?

Yes for standard Unicode characters including Latin, CJK, Arabic, and most accented characters. Emoji that use surrogate pairs (multi-codepoint sequences) may be split at character-granularity mode. For emoji-heavy content, use Word or Line mode.

Related tools

Related articles

Pillar

Part of Data & Format.


Written by Mian Ali Khalid. Last updated 2026-05-12.