ToolBook
Support us on Ko-fi
Help us keep this free, forever

Text Diff Checker

How to compare two texts with a diff checker

Paste old and new versions, optionally tune ignore-whitespace or ignore-case, then scan the side-by-side highlights.

  1. Paste the original version

    Drop the "before" version of your text, code, or config into the left pane.

  2. Paste the updated version

    Drop the "after" version into the right pane. The diff renders instantly with line numbers and word-level highlights.

  3. Tune the comparison options

    Toggle "Ignore whitespace" to skip spacing-only changes. Toggle "Ignore case" for case-insensitive comparison. Use "Swap" to flip which side is original.

  4. Read the highlights

    Removed lines glow red on the left. Added lines glow green on the right. Modified lines show word-level highlights so you can see exactly what changed.

  5. Use the summary chips

    The stat strip at the top shows added, removed, modified, and unchanged line counts plus a similarity percentage at a glance.

Frequently asked questions

What is a text diff checker?

A text diff checker compares two pieces of text and highlights what changed: added lines, removed lines, and modified lines with word-level highlights inside. Same algorithm family as git diff (Hunt-McIlroy LCS), same red/green visual convention, but it works on any two chunks of text without a Git repo.

How do I compare two texts online with this tool?

Paste the original version into the left pane and the updated version into the right pane. The side-by-side diff renders instantly with line numbers, word-level highlights inside modified lines, and a similarity percentage in the stat strip.

Does this work for code as well as prose?

Yes. The diff is line-based and language-agnostic. Drop two versions of a config file, two drafts of an email, two snippets of code, or two paragraphs of prose; the algorithm doesn't care.

Can I ignore whitespace or case differences?

Yes. Toggle "Ignore whitespace" to collapse runs of spaces, tabs, and trailing whitespace before comparing, useful when only formatting changed. Toggle "Ignore case" to treat upper and lower case as equal, useful for case-insensitive content like SQL keywords or environment variable names.

What does the similarity percentage mean?

Similarity is the share of lines that are unchanged between the two versions, expressed as a percentage. 100% means identical; 0% means no shared lines. It is a quick signal for how much of a draft survived an edit pass or how close two outputs are.

Why are some unchanged words highlighted as changed?

When a line is modified, we highlight the words that differ between the old and new versions. If the editing is heavy enough that more words changed than stayed the same, the word-level diff can look noisy. For nearly-rewritten lines, scan the line as a whole and ignore the word highlights.

How is this different from GitHub's diff view?

Same algorithm family (Hunt-McIlroy LCS) and same visual conventions (red for removed, green for added, side-by-side or unified). The difference is reach: this works on any two chunks of text, not just files in a Git repo.

Is the diff stored anywhere?

No. Both texts are processed locally in your browser. Nothing is uploaded, logged, or saved. Paste confidential drafts safely.

What size of text can I compare?

A few thousand lines on each side runs in under a second. The algorithm is O(n*m) so it slows quadratically; comparing 50,000-line files will visibly hang the tab. For very large diffs, use Git or a dedicated diff editor.

Text comparison, the simple way

When to use a diff tool, what the colors mean, and why word-level highlights save edit time.

Why text comparison is one of the oldest computer-science problems

Comparing two pieces of text and showing what changed is a problem that's been studied since the 1970s. The Hunt-McIlroy algorithm, the basis of nearly every diff tool you've ever used, including this one and git diff, was published in 1976 at Bell Labs. It works by finding the longest common subsequence (LCS) between the two inputs, then marking everything outside that subsequence as either "added" (only on the right) or "removed" (only on the left).

Five decades later, the conventions haven't changed. Red for removed, green for added. Side-by-side or unified view. Word-level highlights inside changed lines. The reason none of this has been replaced is that it works.

When you need a diff and you don't have a Git repo

Most diff tools assume you're comparing files in a Git repository. They don't help when you have two drafts of an email, two paragraphs from different versions of a brief, two snippets of code pasted from Slack messages, or two outputs from a tool that you want to verify match.

This page handles all of those. Paste the old version on the left, the new version on the right, and read the highlights. Both texts stay entirely in your browser; nothing leaves the tab.

Reading the colors

The convention is universal:

  • Red, with a strikethrough vibe: content that was in the original but is gone in the updated version (a removal).
  • Green: content that was added in the updated version (an insertion).
  • Saffron / amber: modified lines, where the line is recognizably "the same line" but with internal edits. Word-level highlights inside show exactly which words changed.

Unchanged lines are shown without highlight on both sides. Empty placeholder rows (∅) appear when one side has nothing at that position, e.g. an added line on the right has nothing matching on the left.

Side-by-side vs unified view

The default side-by-side layout keeps the original and updated versions in two columns, so the relationship between lines is easy to see. Unified view stacks every change inline, prefixed with + for additions, - for removals, and ~ for modified pairs, the same format git diff produces in a terminal. Pick side-by-side when you want to read changes in context; pick unified when you want a compact patch-style view to scan or share.

Why word-level diffs sometimes look noisy

When you change one word in a long sentence, the word-level diff is gorgeous: exactly the changed word lights up. When you rewrite half a sentence, the algorithm tries to find the longest common subsequence at the token level and the result can look fragmented: tiny equal segments interspersed with small added/removed segments.

This is unavoidable for substantial rewrites. The signal stays correct (red shows what was, green shows what is), but trust the line as a whole over the word-level highlights when more than half the line was changed.

Ignore whitespace and ignore case

Two toggles let you tune what counts as a real change.

Ignore whitespace collapses runs of spaces and tabs, and trims leading and trailing whitespace, before comparing. Useful when only indentation or formatting changed but the actual content is identical. The original text is still shown in the diff; only the comparison treats the lines as equal.

Ignore case treats upper and lower case as equivalent. Useful for SQL keywords, environment variable names, or anywhere case is incidental. Applied to both the line-level comparison and the word-level highlights inside modified lines.

When this tool isn't the right choice

Two cases:

Very large files. The algorithm is O(n*m), fast enough for a few thousand lines per side, but quadratically slower for tens of thousands. For large diffs, use git diff, an editor's diff view, or a dedicated tool like Beyond Compare.

Diffs across many files. This page compares two pieces of text. For comparing two folders of files, two branches of a Git repository, or two database schemas, use a directory-aware diff tool.

For the in-between case, small to medium texts, two pieces, one comparison, this is the right tool.

A few high-value uses

  • Drafting: paste an old version and a new version of an email or essay; see exactly which sentences moved.
  • Code review on the side: paste two snippets to compare without opening an editor.
  • Output verification: run the same query twice, paste both outputs, confirm they match.
  • Translation review: paste original and translation side by side to spot missing paragraphs.
  • Spec compliance: paste the spec and your implementation; see which clauses you addressed.
  • Contract redlining: paste old and new versions of a contract to spot revisions.

The pattern is always the same: two texts, one question, what changed? This page answers it in one paste.