A diff checker lines up two versions of a text and marks what was removed, added or left alone. Paste both versions here to see changed lines side by side, with the exact words that differ highlighted inside each line. Everything is compared in your browser, so drafts, contracts and source code never leave your device.
| Mark | Meaning | Where |
|---|---|---|
| Red line, minus sign | Only in the original | Left column |
| Green line, plus sign | Only in the changed version | Right column |
| Darker highlight inside a line | The words that changed | Both columns |
| Plain line | Same in both | Both columns |
Updated
Use it for contract revisions, website copy edits, config files or two copies of a function. For structured JSON, where key order should not matter, the JSON diff checker linked below compares values rather than lines.
Paste the original on the left and the changed version on the right. Changed lines are paired side by side with the exact words highlighted, and you can switch to a single-column view or copy a plain-text report.
HTML has elements for exactly this, so a published change log can mark edits without images.
del marks removed text and ins marks added text. Screen readers do not announce them by default, so the CSS adds hidden words that are read aloud.
<style>
del { background: #fde8e8; }
ins { background: #e3f6e8; text-decoration: none; }
del::before { content: "removed: "; position: absolute; clip-path: inset(100%); }
ins::before { content: "added: "; position: absolute; clip-path: inset(100%); }
</style>
<p>Monday to Friday: <del>8am</del> <ins>7am</ins> to 6pm</p>
<p>Sunday: <del>closed</del> <ins>10am to 2pm</ins></p>A small longest-common-subsequence table, the same approach the checker uses, before the head and tail shortcuts and word-level pass.
function diff(a, b) {
const n = a.length, m = b.length;
const dp = Array.from({ length: n + 1 }, () => new Array(m + 1).fill(0));
for (let i = n - 1; i >= 0; i--)
for (let j = m - 1; j >= 0; j--)
dp[i][j] = a[i] === b[j] ? dp[i + 1][j + 1] + 1 : Math.max(dp[i + 1][j], dp[i][j + 1]);
const out = [];
let i = 0, j = 0;
while (i < n && j < m) {
if (a[i] === b[j]) { out.push(" " + a[i]); i++; j++; }
else if (dp[i + 1][j] >= dp[i][j + 1]) out.push("- " + a[i++]);
else out.push("+ " + b[j++]);
}
while (i < n) out.push("- " + a[i++]);
while (j < m) out.push("+ " + b[j++]);
return out.join("\n");
}
console.log(diff(["a", "b", "c"], ["a", "c", "d"]));
The checker splits both texts into lines and finds the longest run of lines the two versions share, in order. Everything outside that shared run is either a removal or an addition. This is the same idea behind most diff programs, which is why the result looks familiar if you have used version control.
When a removed line sits next to an added one, the pair is treated as an edit and compared again word by word. That is how a single changed time in a long sentence lights up on its own instead of the whole line turning red and green.
Ignore case treats Sunday and sunday as the same line. Ignore spacing collapses runs of spaces and tabs and trims line ends, which hides indentation changes in code or stray spaces pasted from a document. Ignore blank lines drops empty lines before comparing.
These options affect which lines match, not what is displayed: the right column always shows the changed text exactly as you pasted it.
Comparison needs memory proportional to the line count of one text times the other. To keep your browser responsive the tool stops at about six million line pairs, roughly two texts of 2,400 lines each, and says so instead of freezing. Lines shared at the start and end are skipped quickly, so long files with a few edits in the middle work best.
It compares plain text only. Formatting from Word or PDF is lost when you paste, and moved paragraphs show up as a removal in one place and an addition in another.
No. Both texts stay in this browser tab and are compared by code running on the page. Closing the tab discards them.
Yes. It works on any plain text, including source code and config files. Turn on ignore spacing if you only changed indentation and want to see real edits.
A line diff keeps lines in order. When a block moves, the shared run is found on one side of it, so the block appears as deleted in its old spot and inserted in its new one.
About six million line pairs, for example 2,400 lines against 2,400 lines. Lines that match at the start and end are skipped before the heavy part, so files with few changes go further.
Related: JSON diff checker, JSON formatter, HTML formatter, CSS formatter, Regex cheat sheet.
Start for free or see all free tools. We.Inc is free to start, with no card needed. AI building is on paid plans from $20 a month.
We.Inc is an AI-powered website builder you can resell under your own brand. Launch a branded client dashboard, bill on Stripe Connect, and deliver AI-generated websites in minutes. White-label plans start at $99 a month for 25 client sites, with a 7-day free trial and no per-site fees.