PoliteTools

More Tools

Compare Two Texts or Lists

Two different comparisons live here, because they answer different questions. Compare text when order matters — a contract, an email, a configuration file — and see precisely what changed, highlighted down to the individual word. Compare lists when membership matters: paste two sets of emails, IDs or SKUs and get what is only in the first, only in the second, in both, or in exactly one, along with anything repeated inside a single list.

nothing you type is sent anywhere

Loading tool…

How to use Diff Checker

  1. Choose 'Compare text' for documents and code, or 'Compare lists' for sets of entries.

  2. Paste each side into its box, or load it from a file.

  3. For text: read the highlighted result — removed in red on the left, added in green on the right.

  4. For lists: pick how each side is split, then read the four set buckets plus repeats within a list.

  5. Sort, change case and pick an output format, then copy or download any bucket — or send it straight back into a box to chain another comparison.

Why comparing by eye fails in a specific way

Reading two versions side by side catches the large changes and misses the small ones, and the small ones are usually what matter. A rewritten paragraph is obvious. A figure changed from 45,000 to 54,000, a deadline moved from 30 days to 15, or a removed "not" in a clause about liability are all invisible to a reader who already knows roughly what the document says — because the eye reads what it expects.

This is not carelessness. It is how reading works: you sample a familiar text rather than processing every character, which is exactly the efficiency that makes proofreading your own writing so unreliable. A mechanical comparison does not sample. It reports every difference regardless of how plausible the surrounding text looks.

The consequence is that comparison is most valuable precisely when you are most confident nothing important changed. A document returned as "the same with a couple of tweaks" is the one worth checking, because the description of what changed came from the person who changed it.

How the comparison works

The two texts are split into lines, and the tool finds the longest sequence of lines they have in common. Everything inside that sequence is unchanged; everything outside it is reported as removed from the original or added to the new version. This is the same model git and most code review tools use, and it is why the result reads as a set of edits rather than a list of every line that moved position.

Within a line that changed, a second comparison runs over the individual words, so only the words that actually differ are highlighted. Without that step a line where one number changed would be flagged red in its entirety, and you would be back to hunting for the difference yourself.

One consequence worth understanding: a block of text that moves is reported as a deletion in one place and an addition in another, because it genuinely is absent from its old position and present in a new one. You can tell a move from a rewrite by the unchanged count, which stays high for a move and drops for a rewrite.

Ignoring whitespace and case, and when not to

Ignoring whitespace collapses runs of spaces and tabs and trims each line before comparing. It is the right setting when a document has been reformatted, a paragraph reflowed, or a block of code reindented, since none of those change meaning and all of them otherwise flood the result with differences that tell you nothing.

It is the wrong setting when whitespace carries meaning. Indentation is syntax in Python and YAML, trailing spaces are significant in Markdown line breaks, and in fixed-width data files column position is the entire structure. Turning the option on in those cases hides real differences.

Ignoring case is narrower in use. It helps when comparing text that has been through a system that normalises capitalisation, or when checking whether two lists contain the same entries. For prose it is usually better left off, since a change from "may" to "May" is rarely accidental and a change in a defined term — Agreement versus agreement — can carry real legal weight.

What people actually use this for

Contract review is the highest-stakes case. A draft goes out, comes back, and the covering email describes two amendments. Comparing takes a minute and answers definitively whether there were two. Keeping the version you sent, clearly named, is what makes this possible — the usual reason a comparison cannot be done properly is that nobody kept a definitive copy of what went out.

Code and configuration are the highest-volume case. Comparing two versions of a config file to find why one environment behaves differently, checking what a colleague changed, or working out which of two similar-looking files is the one currently deployed are all faster to answer here than by reading both.

Then there is the everyday case: two files with different names and dates sitting in different folders, and the question of whether they are the same document or two versions. Paste both and you have an answer in seconds. If you only need to know whether two files are byte-for-byte identical rather than what differs, comparing their hashes is faster still.

Why this one runs in your browser

The things people compare are disproportionately the things they should not upload. Contract drafts before signature, configuration files containing credentials and connection strings, unreleased copy, source code, internal policy documents, and medical or financial records being checked against a corrected version.

Every one of those is more sensitive than the average file, and a comparison tool that uploads receives both versions — which is strictly more information than either version alone, because the differences between drafts often reveal the negotiation itself.

Here the comparison is computed in your browser with JavaScript. Nothing is transmitted, nothing is stored, and the page continues to work if you disconnect after loading it. For a tool whose entire purpose is examining documents at their most sensitive moment, that seems like the only defensible design.

Frequently asked questions

Is my text uploaded to a server?

No. The comparison runs entirely in your browser using JavaScript, so nothing you paste is transmitted, stored or logged. This matters more here than on most tools, because the things people compare are usually the sensitive ones — contract drafts, configuration files containing credentials, unreleased copy, and source code. The page keeps working even if you disconnect from the internet after it loads.

What does 'ignore whitespace' actually do?

It collapses runs of spaces and tabs into a single space and trims each line before comparing, so reindenting a block of code or reflowing a paragraph is not reported as a change. The text shown to you is always the original, unmodified version — only the comparison ignores the spacing. Turn it off when whitespace is meaningful, as it is in Python, YAML, or a file where trailing spaces matter.

Can I compare code files?

Yes, and it is one of the most common uses. Paste both versions or load them from disk, and the comparison works the same way it does for prose. It is line-based with word-level highlighting inside changed lines, which is the same model git and most code review tools use. For very large files the tool falls back to showing the differing region as a whole replacement rather than freezing the page.

Why is a moved paragraph shown as a deletion and an addition?

Line-based comparison finds the longest sequence of lines the two texts have in common, and anything outside that sequence is reported as removed from one side and added to the other. A block that moves is genuinely absent from its old position and present in a new one, so both are reported. The unchanged count stays high, which is how you can tell a move from a rewrite.

What is the difference between side-by-side and unified view?

Side by side puts the two versions in parallel columns with matching lines aligned, which makes it easy to read one version against the other. Unified stacks everything in a single column, marking added lines with a plus and removed lines with a minus — the format used by git and by patch files. Side by side suits reading a document; unified suits scanning a long list of changes.

How do I find what is in one list but not the other?

Switch to 'Compare lists', paste a list into each box, and read the 'Only in A' and 'Only in B' buckets. This is a membership question rather than a positional one, which is why a text diff answers it badly: two exports of the same records in a different order look completely different to a diff and identical as sets. Each bucket can be copied, downloaded, or sent back into a box so you can chain a second comparison against the result.

Can it tell me if a list contains duplicates?

Yes, and this is the part most list comparison tools leave out. Plain set operations silently collapse repeats, so a record exported twice looks the same as one exported once. The 'Repeated within a list' bucket shows entries that occur more than once inside a single list, and every entry displays its count on each side when it appears more than once — so you can see that an ID is present three times in one export and once in the other.

Can I compare two spreadsheet columns?

Yes. Copy a column out of Excel, Google Sheets or Numbers and paste it in — a copied column arrives as one entry per line, which is the default. If your data is a single comma-separated row instead, change that side's split to 'Comma'. The two sides can use different separators, so a comma-separated row compares directly against a column without reformatting anything first.

Why do 007 and 7 not match by default?

Because they are different strings, and for reference codes that difference is often real. Turn on 'ignore leading zeros' when your two exports pad numbers differently and you want them treated as the same value. It applies only to entries that are entirely numeric, so an identifier like 007-ABC is left alone rather than being merged with 7-ABC.

Can I compare two PDFs or Word documents here?

Not directly — this tool compares plain text. For PDFs, use our Compare PDF tool, or extract the text from each file first and paste the results here, which gives you word-level highlighting. For Word documents, converting to PDF and extracting the text works, though Word's own built-in compare feature is better if both files are available to you and you need to see formatting changes too.

What next