Text Diff & Compare
Compare two blocks of text line by lineRuns entirely in your browser — nothing is uploaded. No limits, no signup.
By Alex Johnson. Most of my diffing happens outside of Git. A client sends back a contract with "a couple of small edits," a config file works on one server and fails on another, or I need to know whether this week's export matches last week's. Reading two versions side by side to spot the changes is slow, and I always miss something. The diff checker above does it in about a second, and because it runs inside your browser, neither version gets uploaded anywhere.
Paste the original on the left, the changed version on the right, and press Compare. Every line comes back marked as removed, added or unchanged, with a count of each at the top of the result.
⚡ Quick answer: Paste the original text into the left box of the diff checker above and the new version into the right box, then click Compare. Removed lines show in red with a minus sign and added lines in green with a plus sign. Tick Ignore whitespace or Ignore case to hide formatting-only changes. Nothing is uploaded. Need other utilities? See all 28 tools.
How to compare two texts
- Paste the original version into Original text in the tool at the top of this page.
- Paste the edited version into Changed text.
- Tick Ignore whitespace or Ignore case if formatting differences don't matter to you. Both are explained below.
- Press Compare.
- Read the result, or press Copy result to paste the marked-up diff into an email or a ticket.
If the two versions are identical, the tool tells you "No differences found" and counts every line as unchanged.
Reading the result
Each line of output starts with a marker. A minus sign on a red background means the line was in the original and is gone from the new version. A plus sign on green means the line is new. Gray lines with no marker are the same in both versions, and they're shown so you can see where in the document each change sits.
An edited line appears as a pair: the old wording with a minus, then the new wording with a plus directly underneath. Most real edits look like this, so reading those pairs is most of the job.
Moved text is what confuses people. Move a paragraph from the top of a document to the bottom and a line diff reports it as removed in one place and added in the other, because all it can see is that the order changed. A red block near the top and an identical green block further down means something moved.
What ignore whitespace and ignore case actually do
Ignore whitespace collapses every run of spaces or tabs into a single space and trims both ends of each line before comparing. So total = price and total = price match, and so does a line indented with a tab against the same line indented with four spaces. It doesn't delete spaces outright, which means if(x) and if (x) still count as different.
Ignore case lowercases both versions before comparing, so Shipping Address and shipping address match.
Both options change how lines are matched and nothing else. The output still prints your text exactly as you pasted it. Turn them on after an auto-formatter or a bulk find-and-replace has touched every line and you only care about real edits. Leave them off when the formatting is the thing you're checking, for example in a YAML file, where indentation carries meaning.
Why one small edit can look like a big change
The comparison works on whole lines. For code and config files that's ideal, since a line usually holds one statement. Prose is another matter, because a paragraph is often a single long line, and fixing one comma in it marks the entire paragraph as removed and added again.
The workaround is to put one sentence on each line before comparing. In most text editors, a find-and-replace that swaps ". " for a period and a line break does this in one pass. Do it to both versions, compare, and each changed sentence stands on its own.
You may also see a lone blank line flagged as added or removed at the very end. That means one version ends with a line break and the other doesn't. It's harmless.
How the comparison works
The tool finds the longest common subsequence (LCS) of lines: the largest set of lines that appear in both versions in the same order, even if other lines sit between them. Anything outside that set is a change. Git's default diff, the Myers algorithm, solves the same problem with a faster method, which is why the output here reads like a git diff.
A naive checker compares line 1 with line 1, line 2 with line 2, and so on. Insert one line at the top and every line below it looks different. LCS lines up the shared lines first, so one insertion shows up as one added line and nothing else.
The method builds a table with a cell for every pair of lines, which means two 4,000-line documents need 16 million cells. That is the reason each side is capped at 4,000 lines: at that size the comparison still finishes instantly on a phone. For anything bigger, git diff --no-index file1 file2 on your own machine is the better tool.
Comparing private documents
Contracts in the middle of a negotiation and source code under an NDA are exactly the kind of text people diff. Many online diff sites send both versions to their server to run the comparison. This one runs the whole algorithm in JavaScript on your device. Open your browser's developer tools, go to the Network tab and run a comparison: no request carries your text anywhere. Close the tab and both versions are gone.
Common uses
- Seeing what an editor or client changed between two drafts of a document.
- Finding the one line that differs between a working and a broken config file, such as
.htaccessorpackage.json. - Checking that a revised contract contains only the changes you agreed to.
- Confirming whether two data exports differ before importing one. Run both through the sort list tool first so row order doesn't add noise.
- Checking exactly what another tool changed, for example comparing a list before and after removing duplicate lines.
Compare two texts, nothing uploaded
Line-by-line diff with ignore-whitespace and ignore-case options, running entirely in your browser.
Back to the diff checker ↑Frequently asked questions
How do I compare two texts online for free?
Paste the original version into the left box of the tool at the top of this page and the changed version into the right box, then click Compare. Removed lines are highlighted in red and added lines in green. It runs in your browser with no signup, and nothing is uploaded.
Is it safe to compare confidential documents online?
With this tool, yes. The diff is computed entirely in your browser, so neither text is uploaded or stored. Many other diff checkers send both texts to a server, which is worth checking before you paste a contract or client work into one.
What does a diff checker actually do?
It compares two versions of a text line by line and reports which lines were added, which were removed and which stayed the same. This one uses a longest-common-subsequence algorithm, which solves the same problem as Git's diff, so an inserted line shows up as one addition instead of throwing off every line below it.
Can I ignore whitespace or capitalization differences?
Yes. Ignore whitespace treats lines as equal when they differ only in runs of spaces or tabs, or in leading and trailing spaces. Ignore case treats lines as equal when they differ only in capitalization. Either way, the output still shows your original text.
Is there a limit on how much text I can compare?
Each side can hold up to 4,000 lines, which covers almost any document or source file. Comparisons at that size still finish instantly because everything runs locally in your browser.