Text

Text Diff Checker

Compare two texts online and see every difference highlighted instantly. Choose side-by-side or unified view, zoom in to word or character level, and filter noise with ignore-case and ignore-whitespace options. Everything runs in your browser, your text is never uploaded.

Paste text into both panels above to see the diff.

How the Diff Algorithm Works

The Longest Common Subsequence (LCS) is the classic computer science algorithm this tool uses to find the largest set of lines that appear in both texts in the same order, the same method used by git diff and most version control systems. Read the formal definition on Wikipedia. Everything that is not part of that matching sequence is marked as added or removed.

+ Added

Lines that exist only in the modified text.

- Removed

Lines that exist only in the original text.

Unchanged

Lines identical in both texts, part of the LCS.

Comparison Options Explained

View modes: Split vs Unified

Split view renders two columns, original on the left, modified on the right, so you can read both versions simultaneously. Unified view produces a single stream with + and − prefixes, matching the output of git diff. Unified is easier to copy and paste.

Granularity: Line, Word, Character

Line mode compares whole lines (fastest, best for prose). Word mode highlights individual words that changed within a modified line, great for catching renamed identifiers. Character mode highlights every single character change, useful for spotting typos or punctuation differences.

Ignore case & Ignore whitespace

Ignore case treats Hello and hello as equal. Ignore whitespace collapses multiple spaces and trims line ends before comparing, ideal for comparing code that was reformatted or pasted from a different editor. Both options affect only the comparison logic; the original text is still displayed unchanged in the output.

Hide unchanged lines

Enable this to collapse identical lines and show only the changed regions. Useful when comparing long documents with only a few modifications, similar to the context feature in patch files.

Common Use Cases

Contract and document redlining: Paste the original and revised version of an agreement to catch every change, including the ones easy to miss on a manual read-through: a changed dollar figure, a shifted deadline, or a clause quietly removed. Word-level diff makes a single altered number inside a long paragraph jump out immediately.
Code review: Compare two versions of a function, config file, or SQL query to see exactly what changed before merging, especially useful when reviewing a snippet outside of Git, such as code pasted from a colleague or an AI assistant.
Content and copy edits: Compare a draft against an edited version to see exactly what an editor changed, or compare two AI-generated outputs to spot where they diverge.
Config and log comparison: Diff two versions of a YAML, .env, or JSON config file to confirm only the intended values changed before deploying, or compare log snapshots to isolate what changed between two runs.

Frequently Asked Questions

How does the text diff checker work?▾
The tool uses the Longest Common Subsequence (LCS) algorithm, the same technique behind git diff, to find the largest set of matching lines between your two texts. Lines only in the original appear in red (removed); lines only in the modified version appear in green (added); lines present in both are shown as unchanged. Word and character-level modes run the same LCS logic on tokens within each changed line.
What does "ignore whitespace" do?▾
When enabled, each line is trimmed and consecutive spaces are collapsed to a single space before comparison. This means re-indented code or lines with trailing spaces will compare as identical rather than showing as changed. The original text is still displayed as-is in the diff, only the comparison logic changes.
What does "ignore case" do?▾
When enabled, uppercase and lowercase letters are treated as equal during comparison. For example, "Hello" and "hello" will be counted as the same line. This is useful when comparing text that may have been through automated capitalisation changes or when case differences are not meaningful to you.
Can I use this to compare code?▾
Yes. The diff checker works with any plain text including source code, JSON, HTML, SQL, YAML, and Markdown. Switch to Word or Char granularity to see exactly which tokens changed within a modified line, particularly useful for spotting renamed variables or single-character typos in code.
Is my text sent to a server?▾
No. The entire comparison runs in your browser using JavaScript. Your text is never transmitted to any server, stored in a database, or logged. Closing the tab discards everything immediately.
What is the maximum text size I can compare?▾
The tool processes up to 10,000 lines per input, sufficient for most source files and documents. Texts longer than 10,000 lines are truncated at that limit. The LCS algorithm is O(m×n) in time and memory, so very large inputs with many differences may slow down. For files with hundreds of thousands of lines, a local tool like git diff or diff is more appropriate.
What is the difference between Split view and Unified view?▾
Split view places the original and modified texts side by side in two columns, ideal on wide screens when you want to read both versions at once. Unified view shows a single scrollable column where added lines are prefixed with "+" and removed lines with "−", similar to the output of git diff. Unified view is better on narrow screens or when you want to copy the diff output.
How do I copy the diff output?▾
Once your texts are pasted and differences are detected, a "Copy diff" button appears in the summary bar. Clicking it copies the unified diff (with + / − / space prefixes) to your clipboard. You can then paste it into an email, ticket, or document.
Is it safe to compare confidential contracts or private code here?▾
Yes, in the sense that nothing is uploaded, the comparison runs locally in your browser via JavaScript with no network request carrying your text. That said, always check your own organization's data handling policy before pasting sensitive material into any web page, since the browser tab itself is still running on your device under your control.
Why does a whole line show as changed when only one word is different?▾
That happens in Line mode, which compares entire lines as a single unit, so any difference anywhere in the line marks the whole line as removed-and-added. Switch to Word or Character granularity to see precisely which token changed instead of the full line being highlighted.

By Toolember · Updated September 2026