BrowserTools
Advertisement
Home / Misc / Diff Checker (Text Compare)

Diff Checker (Text Compare)

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

A diff checker compares two pieces of text and highlights what changed between them. Paste an original on the left and a revised version on the right, and the tool lines them up and marks each line as unchanged, added or removed, with line numbers for both sides and a running count of the differences. It is the same idea behind the side-by-side views you see when reviewing code, editing contracts or proofreading drafts.

Loading Diff Checker (Text Compare)… If nothing happens, please enable JavaScript.

Frequently asked questions

Does it compare line by line or character by character?
Line by line. Each line from the original is matched against the revised text using a longest-common-subsequence algorithm, and whole lines are marked added, removed or unchanged. This is the most readable view for prose, config files and code, where edits naturally happen at the line level.
What do 'ignore case' and 'ignore whitespace' do?
They change how two lines are judged equal. 'Ignore case' treats 'Hello' and 'hello' as the same line. 'Ignore whitespace' collapses runs of spaces and tabs and trims the ends, so lines that differ only in indentation or spacing are treated as unchanged. The original text is always displayed as you wrote it; only the comparison is affected.
Is my text uploaded to a server?
No. The comparison runs entirely in your browser with JavaScript. Neither block of text leaves your device, so it is safe for confidential documents, contracts and private code.
What algorithm does it use?
It computes the longest common subsequence (LCS) of the two line lists, then backtracks to label each line. This is the classic approach used by the Unix diff utility and by code-review tools, and it produces minimal, intuitive change sets.
Can it compare JSON, code or CSV?
Yes, any plain text works. For JSON specifically, formatting it first (for example with a JSON formatter) so that each property sits on its own line makes the diff much more meaningful, because the line-based comparison can then isolate the exact field that changed.
Is there a size limit?
There is no hard limit. Line-based LCS uses memory proportional to the product of the two line counts, so extremely large files (tens of thousands of lines each) can get slow, but typical documents and source files compare instantly.

About Diff Checker (Text Compare)

Under the hood it uses the longest common subsequence, the standard algorithm behind tools like the Unix diff command and the review screens on platforms such as GitHub. Rather than comparing character by character, it finds the longest run of lines the two versions share and treats everything else as an insertion or a deletion, which produces a clean, readable result that matches how people think about edits. Options let you ignore case or ignore differences in whitespace, so you can focus on substantive changes and not get distracted by reformatting.

Everything happens locally in your browser. The two texts are never uploaded, which makes the tool safe for comparing contracts, configuration files, private notes or unreleased code. There is no length cap beyond your device's memory, and the comparison is instant for the documents people compare in practice.

The diff that runs the world

The diff utility was written in the early 1970s at Bell Labs, with Douglas McIlroy designing the core algorithm and the theory later published with James Hunt. Its job sounds humble, report the smallest set of changes between two files, but that single capability became the foundation of modern software collaboration. Without it there is no patch, no code review, no merge.

Every version-control system since, from the early SCCS and RCS through to Git, is built on the ability to compute and apply diffs. When you see a green-and-red side-by-side comparison in a pull request, you are looking at a direct descendant of that 1970s algorithm. The same machinery quietly powers document revision history, configuration drift detection and the 'track changes' feature in word processors, making diff one of the most widely used inventions in computing that most people never hear about.

Advertisement