Skip to content

Diff Checker

Compare two blocks of text line by line and see exactly what was added, removed or changed. Runs entirely in your browser.

Runs entirely in your browser. Nothing you paste here is sent to us or anyone else โ€” there is no server processing, no logging of input, and no third-party scripts on this page.

A diff checker compares two blocks of text and shows you exactly what changed โ€” which lines were added, which were removed, and which stayed the same โ€” colour-coded so the differences jump out. Paste the original on the left and the changed version on the right, and the tool above builds a unified, line-by-line comparison in your browser. Nothing you paste is transmitted anywhere.

What is a text diff?

A “diff” (short for difference) is a structured comparison of two versions of the same text. Instead of forcing you to read both versions side by side and spot changes by eye, a diff tool aligns the two inputs and reports the minimal set of edits that turns the first into the second. This is the mechanism behind code review, version control systems like Git, and the “track changes” feature in document editors.

The comparison here works at the line level. Each line from the original is matched against the changed text, and every line falls into one of three buckets:

  • Unchanged โ€” the line exists in both versions, shown in neutral colour with a leading space.
  • Removed โ€” the line was in the original but not the changed version, shown in red with a leading minus sign.
  • Added โ€” the line is new in the changed version, shown in green with a leading plus sign.

How the comparison works

Under the hood the tool computes the longest common subsequence (LCS) of the two line lists. The LCS is the longest ordered set of lines that appears in both inputs; anything outside it must have been added or removed. This is the classic, well-understood approach that underpins most diff utilities, and it produces a clean, minimal result rather than naively marking everything after the first change as different.

A short worked example. Suppose the original is three lines โ€” alpha, beta, gamma โ€” and the changed version is alpha, delta, gamma. The LCS is alpha and gamma, so the diff keeps those two as unchanged, marks beta as removed, and marks delta as added. With word-level highlighting on, the tool pairs the removed and added line and points to the single word that actually changed.

Ignore whitespace and word-level highlighting

Two toggles refine the result. Ignore whitespace compares lines after collapsing internal spaces and tabs and trimming the ends, which is handy when a file has been re-indented or has stray trailing spaces that you do not care about โ€” the real content changes still show, but pure formatting noise disappears. Word-level highlighting takes each changed line, pairs the old and new version, and runs a second diff across their words so only the words that differ are shaded, making a one-character edit inside a long line easy to find.

Common use cases

Scenario What the diff shows
Reviewing a code change Exactly which lines were edited before you commit or paste them back
Comparing two config files Which settings were added, removed, or retuned between environments
Checking an edited paragraph The specific sentences or words a reviewer changed
Spotting log differences New or missing lines between two runs of a program

Tips for a clean diff

Line-based diffs are most useful when the two inputs are already broken into comparable lines. For structured data such as JSON, format both sides with the same indentation first so the tool compares meaning rather than layout. For prose, a paragraph that wraps as one long line will diff as a single unit โ€” split it into sentences if you want finer granularity, or lean on word-level highlighting. And remember the panes are directional: the left side is always treated as the original.

Is it safe to paste sensitive text here?

Yes โ€” this tool never sends your input anywhere. Both the line-level and word-level comparisons happen with JavaScript running on your device. There is no server round-trip, no logging, and no third-party analytics on this page. All text is escaped before it is displayed, so pasting code or markup cannot break or hijack the page. For the most sensitive material you can load the page once and then work offline.

Frequently asked questions

Is my text sent to a server?

No. The comparison runs entirely in your browser with a JavaScript diff algorithm. Nothing you paste is uploaded, logged, or stored, and the tool keeps working if you disconnect from the internet after the page loads.

How does the diff algorithm work?

It computes the longest common subsequence (LCS) of the two inputs at the line level. Lines that appear in both, in the same order, are treated as unchanged; everything else is marked as an addition or a removal. This is the same core technique used by tools like git diff.

What does "ignore whitespace" do?

When enabled, lines are compared after collapsing runs of spaces and tabs and trimming the ends, so a line that differs only in indentation or trailing spaces counts as unchanged. The original text is still displayed exactly as you pasted it.

What is word-level highlighting?

When a line is changed rather than fully added or removed, the tool pairs the old and new versions and runs a second diff over their words, highlighting only the specific words that changed. Turn it off to see whole changed lines marked instead.

Why are additions green and removals red?

It follows the near-universal convention from code review and version control: green for content that exists only in the changed version, red for content that existed only in the original. A minus sign marks removed lines and a plus sign marks added ones.

Can it compare code, JSON, or config files?

Yes. The diff is plain-text and line-based, so it works for source code, JSON, CSV, logs, prose, or any text. For JSON, format both sides with the same indentation first so that only the real differences show up.

Is there a size limit?

There is no upload limit because nothing leaves your device, but the comparison work grows with the product of the two line counts. Very large inputs (millions of line-pairs) are capped to keep your browser tab responsive.

Does the order of the two panes matter?

Yes. The left pane is the original and the right pane is the changed version. Swapping them flips which lines are shown as additions and which as removals, though the set of differing lines stays the same.