Diff Checker
A text diff checker. Paste an original and a changed version to see a line-by-line comparison — additions, removals and unchanged lines highlighted — computed with a longest-common-subsequence diff, entirely in your browser. Handy for comparing configs, logs, JSON, or any two versions of text.
Finding what changed between two texts is not as naive as comparing line one to line one. Insert a single line at the top and a dumb comparison reports every following line as changed. The right answer comes from the longest common subsequence: the longest run of lines that appears in both versions, in the same order. Anchor on that, and everything else falls into place — lines only on the left were removed, lines only on the right were added.
That LCS approach is exactly what git and most diff tools use, because it yields the smallest, most human-sensible set of edits. A modified line naturally shows up as a removal paired with an addition, which is usually how you think about it anyway. This tool computes the line-level LCS of your two inputs and colours the result: unchanged lines as context, removals and additions marked, so you can see the shape of the change at a glance.
Line granularity is the right default for the things engineers actually diff — configs, logs, code, and structured data like JSON. For those, a change is almost always a whole line, and line-level diffing stays clean where word-level would get noisy. One tip for data: pretty-print both sides the same way first (same indentation and key order) so the diff shows real value changes rather than formatting churn. And because it all runs locally, it is safe to compare sensitive configuration without anything leaving your machine.
How it works
- Line-by-line comparison via a longest-common-subsequence diff.
- Additions, removals and unchanged lines clearly marked.
- The same core algorithm git uses — minimal, intuitive changes.
- Runs entirely in your browser; nothing is uploaded.
Frequently asked questions
How does the diff decide what changed?
It computes the longest common subsequence (LCS) of the two texts, line by line — the longest sequence of lines that appears in both, in order. Lines in that common sequence are marked unchanged; lines only in the original are removals, and lines only in the new version are additions. This is the same core algorithm behind git and most diff tools, and it produces the minimal, most intuitive set of changes rather than naively comparing line 1 to line 1.
Is my text sent anywhere?
No. Both inputs are compared entirely in your browser with JavaScript — nothing is uploaded, logged or stored. That makes it safe to diff configuration files, logs or other sensitive text. When you close or reload the page, the data is gone.
Does it diff word by word or line by line?
This tool diffs by line, which is the right granularity for code, configs, logs and structured data, where a change usually means a whole line was added, removed or modified. A modified line shows as one removal plus one addition. Character- or word-level diffing is useful for prose but noisier for code; line-level keeps the comparison clean and readable.
Can I compare JSON or formatted data?
Yes — paste both versions and it diffs them line by line. For the cleanest result, format both sides the same way first (consistent indentation and key order) so that only real value changes show up, rather than formatting noise. Diffing two pretty-printed JSON documents is a common and effective way to spot exactly which fields changed.