By Alex Johnson — comparing two versions of something is one of those tasks that comes up constantly and is miserable to do by eye. Which paragraph did the client change? What did my teammate edit in this config file? Is this the same list I exported last week? I kept pasting things into diff sites that uploaded both versions to a server — which is exactly what you don't want when one of them is a contract or unreleased copy. So the diff checker on Virtual Text Tools runs entirely in your browser. Here is the full guide.
A diff checker answers one question: what changed between these two versions? Paste the original on the left, the revised version on the right, and the tool shows you every added, removed, and unchanged line — the same way developers review code changes, applied to any text at all.
If you have ever squinted at two documents side by side trying to spot the edits, you already know why this tool exists. Human eyes are terrible at this job. An algorithm is perfect at it.
How to compare two texts online
- Open the Text Diff & Compare tool (Code category)
- Paste the original version in the left box
- Paste the changed version in the right box
- Optionally tick Ignore whitespace or Ignore case
- Click Compare
The result appears immediately below: removed lines highlighted in red with a minus sign, added lines in green with a plus sign, and unchanged lines in gray for context. A stats bar shows the totals at a glance, and one click copies the whole annotated result.
What the highlighting means
The output reads like the "track changes" view of a document, but line by line:
- − Red lines existed in the original but are gone from the changed version — deletions
- + Green lines exist only in the changed version — additions
- Gray lines are identical in both versions — shown so you can see where in the document each change sits
A line that was edited (rather than added or deleted outright) shows up as a red–green pair: the old wording removed, the new wording added right below it. Reading those pairs is the fastest way to review someone's edits.
When to use ignore whitespace and ignore case
Sometimes two versions differ in ways you don't care about. Code that was auto-formatted has different indentation but identical logic. A list that was recapitalized has the same items. The two toggles handle exactly this:
- Ignore whitespace collapses runs of spaces and tabs and trims line edges before comparing — so
if (x) {andif (x) {count as the same line - Ignore case compares lines case-insensitively — so
Shipping Addressandshipping addresscount as the same line
Turn them on when you want to see substantive changes only; leave them off when formatting itself is what you are checking.
How the comparison works under the hood
The tool uses a longest common subsequence (LCS) algorithm — the same family of algorithms behind git diff and every serious version-control system. LCS finds the largest set of lines the two versions share in the same order, and everything outside that set is, by definition, an addition or a deletion. The result is the minimal honest description of what changed, rather than a naive line-by-line comparison that falls apart the moment one line is inserted at the top.
Because the algorithm runs as JavaScript on your own device, comparing even large documents is instant, and neither version is ever transmitted anywhere.
Common uses for a text diff tool
- Reviewing edits to a document: see exactly what a client, editor, or teammate changed between drafts
- Comparing code or config versions: spot the one line that changed in a
package.jsonor an.htaccessfile - Checking contract revisions: verify that the only changes in the new version are the ones you agreed to
- Verifying data exports: confirm whether this week's CSV export actually differs from last week's
- Deduplicating content: check whether two similar articles or product descriptions are actually identical
- Debugging text processing: compare a tool's input and output to see precisely what it modified
Why browser-based comparison matters
Diffing is unusual among text tasks because it routinely involves sensitive text: contracts mid-negotiation, unpublished writing, proprietary code, client deliverables. Most online diff sites process the comparison server-side, meaning both versions of your document travel to someone else's machine.
Virtual Text Tools computes the entire diff locally. Open your browser's network tab while comparing: zero outgoing requests. When you close the tab, both versions are gone — we never had them.
Compare two texts free — nothing uploaded
Line-by-line diff with ignore-whitespace and ignore-case options. Runs entirely in your browser.
Open the diff checker →Frequently asked questions
Is it safe to compare confidential documents online?
With this tool, yes — the comparison runs entirely in your browser and neither text is uploaded. With many other diff sites, both versions are sent to a server, which is worth checking before pasting anything sensitive.
What algorithm does the diff use?
A longest-common-subsequence (LCS) line diff — the same approach used by Git. It produces the minimal set of additions and deletions between the two versions.
Can I compare more than plain text?
Anything that can be pasted as text works: code, HTML, CSV rows, JSON, lists, prose. The comparison is line-based, so formats with meaningful line structure diff especially well.
Is there a size limit?
Up to 4,000 lines per side, which covers nearly any document or source file. Comparisons are instant because everything runs locally.
Does it work offline?
Once the page has loaded, yes. The diff is pure local JavaScript, so it keeps working with no internet connection.