How to Compare Two Texts
Spotting what changed between two versions of a document, config file or code snippet by eye is slow and unreliable — and a naive comparison makes it worse, because inserting a single line at the top makes every following line look different. This tool uses a proper longest-common-subsequence algorithm, the same family of approach that powers version-control diffs, so it finds the largest set of lines the two texts genuinely share and marks only the real additions and deletions around them. Paste your original on the left and the changed version on the right; the diff appears instantly, colour-coded with green additions, red deletions and grey unchanged lines, plus a running count of each. Turn on ignore case or ignore whitespace when reformatting has introduced noise you don't care about, and switch to the only-changes view to strip out everything that stayed the same. Everything is computed in your browser, so confidential documents and proprietary code never leave your device.
Paste both texts
Original on the left, changed version on the right.
Tune the comparison
Optionally ignore case or whitespace, or show only changed lines.
Read or copy
Review the colour-coded diff or copy it in unified +/- form.
How the Diff Works
Longest common subsequence
The algorithm finds the longest sequence of lines that appears in both texts in the same order. Everything outside that sequence is a genuine addition or deletion — which is why inserting one line doesn't mark the whole rest of the file as changed.
Line granularity
Comparison happens line by line, so editing a few words within a line shows as that whole line being removed and re-added. That's the standard behaviour of most diff tools and keeps the output easy to scan.
Reading a Diff
| Marker | Colour | Meaning |
|---|---|---|
| + | Green | Line exists only in the changed text — it was added |
| − | Red | Line exists only in the original — it was removed |
| (blank) | Grey | Line is identical in both texts — unchanged |
A modified line appears as a removal followed by an addition, since comparison is line-based.
Common Use Cases
Code review
Compare two versions of a function or file before committing.
Config drift
Spot what differs between a working and a broken configuration.
Document revisions
See exactly what an editor changed in a draft.
Contract versions
Compare two revisions of an agreement line by line.
Log comparison
Find where two log outputs diverge.
Data verification
Confirm an export matches the expected content.
Translation checks
Compare source and updated copy for changes.
Debugging output
Diff expected versus actual results in tests.
Tips & Best Practices
Ignore whitespace for reformatted code
If a formatter changed indentation, ignoring whitespace reveals the changes that actually matter.
Use only-changes for long files
Hiding unchanged lines makes a large diff far quicker to review.
Format both sides first
Running both texts through a formatter before diffing removes cosmetic noise.
Swap to check direction
Flipping the sides helps confirm whether a line was moved rather than changed.
Expect edits as remove + add
Line-based diffs show a modified line as a deletion followed by an addition — that's normal.
Watch trailing whitespace
Invisible trailing spaces cause surprising differences; ignore whitespace to rule them out.
Troubleshooting
Everything shows as changed
Different line endings or indentation can do this. Turn on ignore whitespace, and check both texts use the same formatting.
A small edit marked a whole line
Comparison is line-based, so any change within a line marks that line as removed and re-added.
Lines look identical but differ
There's probably invisible trailing whitespace or a non-breaking space. Enable ignore whitespace to confirm.
The diff feels approximate on huge inputs
For extremely large texts the tool falls back to a faster positional comparison to stay responsive. Split the input for a full LCS diff.
Frequently Asked Questions
How do I compare two texts for free?
Paste the original and changed versions above and the differences appear instantly, colour-coded — free, no signup.
What algorithm does it use?
A longest-common-subsequence diff, the same approach behind version-control tools, so insertions don't cascade into false differences.
Is the comparison line by line?
Yes. Lines are the unit of comparison, so a change within a line shows as that line being removed and re-added.
Can I ignore capitalisation?
Yes. Turn on ignore case and lines differing only in capitalisation are treated as identical.
Can I ignore indentation?
Yes. Ignore whitespace collapses spacing differences so only substantive changes appear.
How do I hide unchanged lines?
Enable the only-changes view to display just the additions and deletions.
What do the colours mean?
Green with + means added, red with − means removed, and grey means unchanged in both texts.
Does it tell me if the texts match?
Yes. When there are no additions or deletions it states clearly that the two texts are identical.
Can I copy the diff?
Yes. One click copies the diff in unified form with + and − markers.
Can I swap the two sides?
Yes. The Swap button flips them so you can view the change from the other direction.
Is my text sent to a server?
No. The comparison runs entirely in your browser, so nothing leaves your device.
Can I diff code?
Yes. It works well for code, config files, JSON, logs and plain prose alike.
Is there a size limit?
Large texts are handled comfortably; for extremely large inputs the tool switches to a faster comparison to stay responsive.
Does it detect moved lines?
A moved line appears as a deletion in one place and an addition in another, which is standard diff behaviour.
Why do line endings matter?
Different line endings can make lines look different. Ignore whitespace helps, and normalising the files is best.
Does it work offline?
Once the page has loaded it runs entirely in your browser, so it keeps working without a connection.
Does it work on phones?
Yes, in any modern browser on Windows, Mac, Android or iPhone with nothing to install.
Is this tool really free?
Completely free, forever — no account, no ads and no premium wall.
100% free · No signup · Processed in your browser · Data never sent
Last updated: August 2026 · FlipMyFormat Diff Checker
Written and maintained by the FlipMyFormat team · Runs entirely in your browser