toolember

Text tools

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

This tool uses the Longest Common Subsequence (LCS) algorithm , the same method used by git diff and most version control systems. LCS finds the largest set of lines that appear in both texts in the same order, then marks everything else 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.

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.