TTKTheTextKit

Diff Checker

Paste the original text in the left box and the changed text in the right box, then click Compare. The tool performs a line-by-line diff with line numbers and highlights additions in green and deletions in red, making it easy to spot what changed between two versions. All comparison runs in your browser — no files are uploaded.

Related Tools

[5 suggestions]

Guides for the Diff Checker

About the Diff Checker

The Diff Checker compares two texts line by line with Myers' O(ND) algorithm, the default diff algorithm in Git. It finds the fewest added and deleted lines that turn the original into the changed text. Lines only in the original are marked as deletions (red), lines only in the changed text are additions (green), and the rest is shown as unchanged context with line numbers for both sides. Because the running time depends on how many lines changed rather than on the product of the two file sizes, a large file with a few edits compares in milliseconds: 100,000 lines with 40 changed lines took about 0.14 seconds in our tests. Windows (CRLF), Unix (LF) and old Mac (CR) line endings are treated as the same, so a file saved on another system does not show every line as changed. Two options help with noisy differences: ignore_case, and ignore_whitespace, which ignores spaces and tabs at the ends of lines and treats a run of spaces as one. If the two texts differ in more than 20,000 lines the tool says so instead of freezing the page. Everything runs in your browser. Common uses include comparing versions of a configuration file, checking what changed between two drafts and reviewing edits to a contract.

Is this a word-level or line-level diff?▾

The diff operates at the line level — each line is treated as a single unit. Lines that are present in one version but not the other are highlighted entirely. Word-level diffing within a changed line is not currently performed.

How does the diff algorithm work?▾

It looks for the longest common subsequence: the largest set of lines that both texts share in the same order. Lines outside that set are additions (only in the new text) or deletions (only in the original). The tool uses Myers' algorithm, which Git uses by default, and it always returns the smallest possible number of changed lines.

Is there a size limit for the inputs?▾

Large files work well when they are mostly alike: 100,000 lines with 40 changed lines took about 0.14 seconds in our tests. The time grows with the number of changed lines, so two completely different texts of 3,000 lines each took about 0.7 seconds. Above 20,000 changed lines the tool stops and asks you to compare smaller parts.

Why do all my lines show as changed when the text looks the same?▾

The usual cause is line endings: Windows files end lines with CR and LF, Unix files with LF only. This tool treats them as the same. If lines still differ, the cause is probably trailing spaces, tabs or different capitals, which the ignore_whitespace and ignore_case options skip.