Skip to main content
UtilityStack

Diff Checker — line-by-line text comparison

Paste two versions of any text and read the line-by-line differences instantly. Powered by the classic LCS algorithm running in your browser.

+21=3
Original
Modified
Differences
Hello world
This line stays the same
-A line that will be removed
+A brand new line in B
+Another new line
Common line at the bottom

What is a text diff?

A diff is a structured way to describe how two pieces of text differ — which lines were added, which were removed, and which stayed the same. The output looks like the unified diff that 'git diff' or 'diff -u' produces, with + for added lines and − for removed ones.

This tool computes the diff using the longest-common-subsequence algorithm — the same approach behind GNU diff, git, and most code-review tools. Computation is O(n·m), where n and m are the line counts of each side, which is fast enough for thousands of lines in the browser. Nothing leaves your machine.

How to use this tool

  1. Paste your original text on the left and the modified version on the right. Sample text is preloaded so you can see the output before pasting your own.
  2. Optionally toggle 'Ignore whitespace' or 'Ignore case' if you want the diff to skip those kinds of changes when comparing lines.
  3. Read the unified diff at the bottom: green = added in the modified version, red = removed from the original, plain = unchanged. The summary count above the panes shows totals.

Frequently asked questions

Are my texts sent to a server?

No. The diff is computed entirely in your browser using a small JavaScript implementation of the LCS algorithm. Your inputs never touch our servers, so the tool is safe even with confidential code or contracts.

How big a text can I diff?

The algorithm is O(n·m), so two files of 5,000 lines each take a few hundred milliseconds in a modern browser. Beyond ~20,000 lines per side the UI may feel sluggish; for huge inputs use 'git diff' or 'diff' on your machine.

Why does the diff sometimes show oddly chopped-up changes?

LCS is a line-level diff: changing one word in the middle of a long line shows the whole line as removed and added. Word-level highlighting requires a different algorithm; this tool keeps things line-based for simplicity and speed.

Does it support directory or binary diff?

No, only text. For directory or binary comparison, use desktop tools like Meld, kdiff3 or git diff --no-index.

How do 'ignore whitespace' and 'ignore case' work?

Both options affect the comparison only — the displayed lines remain in their original form. Ignore whitespace collapses runs of spaces/tabs to a single space and trims line ends; ignore case normalises both sides to lowercase before comparison.

Common use cases

Where a quick line-by-line diff saves real minutes.

Code review prep

Pulled a colleague's branch and want to know what changed before opening the editor? Paste the relevant file's two versions and skim the diff in seconds — faster than launching a full diff tool.

Compare two configurations

Diff your staging and production .env files (with secrets removed!) to spot drift, or compare two YAML manifests to check that a copy-paste was clean.

Proofread translations

Compare an old vs new translation file (after redoing the JSON) to confirm only the keys you intended changed and nothing else was accidentally rewritten.

Spot copy-edit changes

When a co-author returns a Google Doc as plain text, paste both versions to see exactly which sentences were touched, instead of re-reading the whole thing.

Tips and shortcuts

Habits that turn diff into a daily-driver tool.

Trim before pasting

If you only care about a particular section, paste just that section. Diffing a 10-line snippet from each side is faster to read than diffing two full files where 95% is identical.

Toggle ignore-whitespace for code

Many diffs in code are just re-indentation. Turning on ignore-whitespace lets the LCS algorithm find the real semantic changes underneath.

Watch line endings

Files saved on Windows (CRLF) vs Unix (LF) will produce a diff where every single line looks 'changed'. Most editors can normalise line endings on save; if your diff is suspiciously full, check this first.

Pair with a side-by-side diff for big changes

Unified diffs are great for quick reviews but lose the spatial relationship between added and removed lines. For larger refactors, pop the file into a side-by-side viewer (VS Code, GitHub PR view) instead.

Outils similaires