Text Diff / Compare
Compare two texts line by line — added and removed lines highlighted.
What is Text Diff / Compare?
Text Diff / Compare puts two texts side by side and highlights what changed line by line — added lines in green, removed lines in red, with totals at the top. It uses the same longest-common-subsequence approach as git diff, and this free online diff checker runs entirely in your browser.
Key features
- Line-by-line comparison with added and removed highlighting
- Ignore whitespace and ignore case options
- Added and removed line counts at a glance
- Identical badge when both texts match
- LCS diff — the same approach behind git diff
Text Diff — compare two texts line by line
Paste two versions of the same thing — a document, a config file, a block of code, two translations — and this shows exactly what changed between them, line by line. It uses a longest-common-subsequence (LCS) diff, the same core algorithm behind git diff, and runs entirely in your browser; neither text is uploaded.
How to use it
- Paste the original on the left and the changed version on the right.
- Optionally toggle Ignore whitespace and Ignore case so reindentation or a capitalization change isn't counted as a real difference.
- Read the result: added lines are highlighted green with a
+, removed lines red with a−, and unchanged lines stay neutral. The header shows the total added and removed counts, or an Identical badge when the two texts match exactly.
It compares whole lines — this is the key thing to understand
The diff works at the line level, not word or character level. Change a single word in a long sentence and that entire line is reported as one line removed and one line added — the two versions are shown in full, not with just the changed word highlighted. This is exactly how git diff behaves, and it's usually what you want for code and config. But it has a consequence for prose: a whole paragraph written as one unbroken line counts as a single line. Edit one comma in it and the entire paragraph flips to removed-plus-added.
The fix is to give the diff more line breaks to work with. Put each sentence on its own line, or split long paragraphs, and the tool can then pinpoint the one sentence that changed instead of flagging the whole block.
When the two options earn their keep
- Ignore whitespace is for when the content is identical but the formatting moved — code that was reindented, trailing spaces an editor added, tabs swapped for spaces. Without it those show up as changes; with it they don't.
- Ignore case treats
Erroranderroras the same line. Useful when comparing text where capitalization is noise rather than signal.
What it's good for
- Checking what changed between two versions of a config file or
.envbefore you deploy. - Spotting edits between two drafts of a contract, an email, or an article.
- Comparing two translations or localization files to see which strings differ.
- Confirming two files hold byte-for-byte the same content — the Identical badge is a quick yes/no.
Because it all runs locally, you can safely diff sensitive material — credentials, internal configs, private documents — without any of it leaving your machine.
Frequently asked questions
- Why does changing one word mark the whole line as changed?
- The diff compares whole lines, not individual words — the same way git diff works. A one-word edit shows the old line as removed and the new line as added. Put each sentence on its own line to narrow the diff down to the exact change.
- I'm comparing two paragraphs and it flags everything — why?
- If a paragraph is one long unbroken line, the tool sees it as a single line, so any edit flips the whole paragraph to removed-plus-added. Break the text into shorter lines (one sentence each) and it can isolate the specific change.
- What does "Ignore whitespace" actually do?
- It stops changes in indentation, trailing spaces, or tabs-versus-spaces from counting as differences, so two blocks with identical content but different formatting compare as equal. Leave it off when whitespace matters, like in whitespace-sensitive code.
- Is my text uploaded anywhere?
- No — the comparison runs entirely in your browser with a local LCS algorithm, so you can safely diff credentials, configs, or private documents. Neither the original nor the changed text is ever transmitted.
- How do I know if two files are exactly identical?
- When both sides match, the header shows an "Identical" badge instead of added/removed counts. Otherwise you get the totals, like +3 added and −2 removed, at the top of the result.
Privacy
The line-by-line comparison runs locally in your browser; neither text you paste in is ever transmitted to a server.
