JSONToonPro
Text tool

Text Diff Checker

Paste two versions of any text and see exactly what changed, with added and removed lines highlighted side by side. Ideal for code review, proofreading drafts, spotting config drift, and comparing API responses. Everything runs 100% client-side in your browser, so nothing is ever uploaded.

100% client sideInstant compareNo data sent
Original
Changed

What a Diff Is and How It Works

A diff is a compact summary of what changed between two versions of some text. Instead of re-reading both copies and hunting for differences by eye, you let the tool mark exactly which lines were added, which were removed, and which stayed the same. The classic approach works line by line and rests on a neat idea from computer science called the longest common subsequence.

At a high level the algorithm looks for the longest sequence of lines that appears, in order, in both versions. Those lines are the unchanged backbone shared by the two texts. Anything that is not part of that common backbone has to be either an insertion in the new version or a deletion from the old one, and that is precisely how the added and removed markers are worked out. It is the same core logic that powers the diff you see every day in Git.

Where Developers Use Diffing

Comparison shows up constantly once you start noticing it. Code review is built on it: a reviewer reads the diff of a pull request, not the whole file. Git uses it to store and merge history, and it is the thing you stare at when you resolve a merge conflict. Beyond code, people diff config files to spot drift between a staging and a production server, proofreaders compare two drafts of a document, and API developers diff two JSON responses to see what a change to the backend actually altered.

Unified vs side-by-side

A unified view stacks the changes in one column, prefixing removed lines with a minus and added lines with a plus, which is compact and reads well in a terminal. A side-by-side view puts the old version on the left and the new on the right so you can scan across for each change. Neither is better in the abstract; side-by-side is easier for large rewrites, unified is easier for small tweaks.

Line, word, and character diffs

Line diffs are the default and are perfect for source code. When a single line changed by one word, though, a line diff bluntly reports the entire line as removed and re-added, which hides the real edit. A word diff or a character diff zooms in and highlights just the token that moved, which is far kinder when you are proofreading prose or checking a one-character typo.

Ignore Whitespace and Ignore Case

Two options quietly save a lot of noise. Ignore-whitespace tells the comparison to treat reindented or reflowed text as unchanged, so a formatter that re-wrapped every line does not drown out the one real edit buried inside. Ignore-case does the same for capitalization, useful when a rename changed "Id" to "ID" everywhere and you only care about the substantive changes. Turn them off when the whitespace or the case is the change you are hunting for.

The comparison above runs entirely in your browser. Neither block of text is uploaded anywhere, so you can safely diff private source code, contracts, or API payloads.

Need something else? Explore every text tool in one place, all free and client-side.

Frequently asked questions

4 answers
It compares your two blocks of text line by line and marks which lines were added, which were removed, and which stayed the same. Under the hood it uses a longest common subsequence approach: it finds the longest run of lines shared by both versions, and everything outside that run is flagged as an insertion or a deletion.

More JSON Tools