How to use it
This diff checker puts two versions of a text side by side, the original on the left and the changed version on the right, and colors every difference: changed lines red and green, removed lines red, added lines green. Inside a changed line, the exact words or punctuation that differ are marked. Lines are aligned with the Myers algorithm, and the comparison runs in your browser.
How to use the diff checker
- Paste the older version into the "Original text" box.
- Paste the newer version into the "Changed text" box next to it.
- Tick "Ignore whitespace differences" or "Ignore upper/lower case" if those changes do not matter to you.
- Click "Run tool" or press Ctrl + Enter to compare the two texts.
- Read the colored table, or use "Copy output" or "Download output" to keep a plain-text version.
Reading the side-by-side table
A summary line sits above the table, for example "Changed: 1 · Added: 1 · Removed: 0 lines". Each side keeps its own line numbers, so after two lines are inserted near the top, line 12 on the left sits next to line 14 on the right. The colors follow one rule throughout:
| Row | Left (original) | Right (changed) |
|---|---|---|
| Changed | Red background; the removed words in darker red, struck through | Green background; the new words in darker green |
| Removed | Red background | Empty, hatched cell |
| Added | Empty, hatched cell | Green background |
| Unchanged | No color | No color |
Take a config file whose original reads timeout: 30, retries: 3, region: eu-west. In the new version the timeout is 60 and verbose: true was appended. The first row is a changed row in which only 30 and 60 are marked, the next two are plain, and the last one is green on the right with a hatched cell on the left. On a phone the two columns stack: the old line appears directly above the new one, and unchanged lines are printed once. If the texts match, you get "No difference found." instead of a table.
How the diff checker matches lines
A naive comparison pairs line 1 with line 1 and line 2 with line 2, so a single heading added at the top makes every following line look different. This tool strips the shared beginning and end of both texts and aligns the rest with the Myers algorithm, which finds the shortest list of insertions and deletions. One inserted line therefore produces one green row and nothing else.
Inside each block of edits, removed and added lines are paired by similarity: shared words, or a shared beginning or end of a word. Suppose a lease clause changes from "the 5th of each month" to "the 10th of each month" and a new sentence about late fees is inserted just above it. The new sentence shows up as an added line, while the clause sits next to its new version with only 5th and 10th marked. Lines that share nothing but occupy the same position are still placed side by side as a changed pair, with the whole line highlighted.
When two lines have no word in common, as with a one-word line containing a typo, the tool compares characters instead. recieve against receive marks only ie and ei, because the start and end match. If too little matches, as with Hello, world against Goodbye, the whole line is marked. A block that moved is the one change it cannot express as a move: it appears as removed in its old place and added in the new one.
Options, folding and copying
- Ignore whitespace differences treats runs of spaces and tabs as a single space and ignores spaces at the start and end of a line. Indentation changes and trailing spaces then stop producing rows. A non-breaking space pasted from a web page also counts as an ordinary space.
- Ignore upper/lower case makes "Error" and "ERROR" equal. Both options are off by default and only affect the comparison: the table always shows your text exactly as you pasted it.
- Folding. Long stretches of unchanged lines collapse into a bar such as "42 unchanged lines hidden, click to show". Three lines of context stay above and below every change, enough to see where you are without scrolling through the whole document.
- Unified text. "Copy output" and "Download output" produce a classic unified listing: unchanged lines start with two spaces, removed lines with
-and added lines with+. A changed line becomes a minus line followed by a plus line, and folded lines are included.
Details that trip people up
- Line endings and a BOM do not count. Windows (CRLF) and Unix (LF) line breaks are treated the same, and a byte order mark at the start of a file is ignored, so a file re-saved by another editor does not light up red.
- A final line break does count. If only one text ends with an extra Enter, the table shows an empty line as added or removed.
- A paragraph is one line. Word highlighting shows what changed inside a long paragraph, but the copied output repeats the whole paragraph as a minus line and a plus line. For prose, putting each sentence on its own line keeps the report short and the pairing precise.
- Normalize structured data first. Format both JSON payloads with the JSON formatter, or both pages with the HTML beautifier, before comparing. A minified file against a pretty-printed one is a single long line against hundreds.
- Huge inputs. With tens of thousands of differing lines or thousands of separate edits, the tool stops aligning in detail and lines up the differing region in order. Compare very large files in sections.
Everyday uses
- Contracts and documents: see which clauses, dates or amounts the other side edited in a returned draft, without relying on their tracked changes.
- Code snippets: compare two versions of a function, a SQL query or a config file that never went into version control.
- Translations: put the old and new source text side by side to find the sentences that need translating again, or compare two translators' versions of the same original.
- Lists and CSV rows: sort two exports the same way, then compare them. When
1,Lamp,20becomes1,Lamp,25, only the price is marked, and new records appear as green rows.
Privacy
Both texts are compared by JavaScript in your browser and are not sent anywhere; the page only increments an anonymous counter when the tool runs. That makes the diff checker suitable for drafts, internal documents and configuration files. To measure the length of either version, use the character counter, or browse more text tools.