Home / Code & Encoding Tools / Diff Checker
Diff Checker
Compare two blocks of text and see exactly what changed — line-by-line additions and deletions, side-by-side or unified, with ignore-case and ignore-whitespace options.
What a diff actually shows
A diff is the shortest description of how to turn one text into another: which lines were added, which were removed, and which stayed the same. Comparing two files line by line is the fastest way to answer the question "what changed?" without rereading everything.
How the line matching works
This tool compares your two texts with a longest common subsequence (LCS) algorithm. It looks for the largest set of lines that appear in both inputs *in the same order*, treats those as unchanged, and everything else becomes an addition or a deletion. That is the same family of algorithm behind `git diff`.
Because the comparison is line based, a single inserted line shows up as one addition rather than a cascade of changes — which is exactly what you want when reviewing edits.
When this is useful
- Code review without a repository: paste the old function and the new one.
- Configuration files: spot the one setting that differs between a working and a broken setup.
- Contracts and documents: confirm that only the clauses you expected were modified.
- Translations: check that a translator did not drop or duplicate a paragraph.
- Lists and data: compare two exports of contacts, product codes or CSV rows to find what was added.
- Writing: keep the previous draft and see what your editing pass actually changed.
Reading the output
- Side-by-side puts the old text on the left and the new text on the right, aligned on the unchanged lines — the easiest view for understanding an edit in context.
- Unified is the compact form, with a marker per line: unchanged, plus for added, minus for removed. It reads top to bottom like a patch file.
- The counters above the result give the number of added and removed lines plus a similarity score, computed as the shared content divided by the combined length. A high score with a few changes is usually a careful edit; a low score often means the text was rewritten or replaced wholesale.
Making the comparison say what you mean
Whitespace and casing create noise that hides the changes you care about:
- Ignore case treats `User` and `user` as equal — useful when a rename changed only capitalisation.
- Ignore whitespace collapses spacing and indentation differences, which matters when one side came from an editor with different tab settings.
- Ignore blank lines removes empty-line noise from reformatted files.
Turn the options on *after* looking at the raw result if you are unsure whether a difference is real.
Privacy and limits
Many online diff tools upload both texts to a server to compute the comparison. This one does the maths in JavaScript on your own machine, so source code, contracts and personal data stay where they are.
Practical limits: the algorithm compares lines, so a rewritten paragraph on a single long line counts as one removed line plus one added line rather than showing word-level edits. Very large inputs (tens of thousands of lines) are better handled by a desktop tool or `git diff`.
How the differences are marked
The output is colour-coded and, so it still reads in black and white or in a screenshot, marked with a symbol:
- Removed lines get a pale red background, a red bar on the left and a `−` marker — they exist only in the left-hand box.
- Added lines get a pale green background, a green bar on the left and a `+` marker — they exist only in the right-hand box.
- Unchanged lines stay white with a blank marker column, so your eye slides over them.
- The legend under the summary repeats this key, and the Changes only checkbox hides every unchanged line, which is the fastest way to review a long file. If the two texts match exactly, the tool says so instead of drawing an empty table.
FAQ
Is my text uploaded to a server?
No. Both texts are compared with JavaScript in your browser; nothing is sent, stored or logged. You can confirm this in your browser's Network tab while pasting and comparing.
Why does a small edit sometimes look big in the result?
The comparison works line by line. If a paragraph is all on one line, any rewrite of it counts as removing that line and adding a new one. Try the ignore-whitespace option, or split long lines into shorter ones before comparing.
What does the similarity score mean?
It is the ratio of the matched (unchanged) content to the total size of both versions combined. Two identical texts give 100%; completely unrelated texts give close to 0%. Use it as a quick signal of how much was touched, not as an exact measure of meaning.
Can I compare very large files here?
It handles a few thousand lines comfortably, but the algorithm gets slower as both sides grow, so tens of thousands of lines are better handled by a desktop diff tool or git. For big files, comparing only the changed section is usually faster and clearer anyway.
How do I tell which lines changed?
Removed lines are pale red with a − marker and exist only on the left; added lines are pale green with a + marker and exist only on the right; unchanged lines stay white with an empty marker column. Tick "Changes only" to hide everything unchanged. If both texts are the same the tool tells you so.