A text diff checker compares two pieces of text and shows exactly what changed between them — which lines were added, which were removed, and which stayed the same. Instead of reading both versions side by side and trying to hold the differences in your head, you paste them into a text difference checker and get a single colour-coded view in seconds. This text comparison tool uses a classic longest-common-subsequence (LCS) algorithm to find the real changes, marks additions in green and deletions in red, and runs entirely in your browser so nothing you paste ever leaves your device. The sections below explain what a diff is, how the algorithm works, the different granularities of comparison, and how to use a diff checker well for writing, code, contracts and content versioning.
What is a text diff?
A diff — short for difference — is a structured description of how one version of a text differs from another. Rather than giving you two blocks to eyeball, a diff reduces the comparison to three simple categories: lines that were added, lines that were removed, and lines that are unchanged. Present those three categories clearly and a reviewer can see the entire history of an edit at a glance.
The idea comes from software engineering, where the Unix diff utility has compared files since the 1970s, but it is just as useful anywhere text evolves. When you compare two texts — two drafts of an article, two revisions of a contract, two exports of a product description — what you really want to know is not “are these different?” but “*what* is different, and *where*?” A good diff answers both at once, which is why the ability to find the difference between texts quickly is one of the most-reached-for utilities in any writer’s or developer’s toolkit.
How this diff checker works
Using the tool is deliberately simple. Paste the earlier version into the Original box on the left and the later version into the Changed box on the right. The comparison runs immediately — there is no upload step and no waiting — and the unified result appears below, line by line:
- Unchanged lines are shown on a neutral background with no prefix. They anchor the diff so you can see edits in context.
- Added lines appear on a green background with a + prefix — content that exists in the changed version but not the original.
- Removed lines appear on a red background with a − prefix — content that was in the original but is gone from the changed version.
Above the result, a summary counts the total additions, deletions and unchanged lines, so you get a quick sense of how large the change is before reading it in detail. The Swap button flips the two sides — handy when you pasted the versions the wrong way round — and the Sample button loads a worked example so you can see the output shape before using your own text.
The LCS algorithm behind the diff
The quality of a diff comes down to the algorithm that produces it, and the standard choice is the longest common subsequence, or LCS. A subsequence is any sequence of lines that appears in the same order in both texts, though not necessarily next to each other. The longest common subsequence is the biggest such set — and those lines are, by definition, the ones that did not change.
Once the algorithm knows the longest run of shared lines, the rest follows cleanly. Any line in the original that is not part of that shared sequence must have been removed. Any line in the changed version that is not part of it must have been added. This is why an LCS diff feels so natural to read: it keeps the maximum amount of text marked as “unchanged” and flags only the genuine edits, instead of a naive line-for-line match that would mark everything after a single inserted line as different.
Under the hood the tool builds a dynamic-programming table of size n × m, where n and m are the line counts of the two texts, then walks back through that table to produce the unified list of rows. That is the same foundation that powers Git’s diff, code review tools and version-control systems everywhere. For the few-hundred-line inputs this tool is built for, it is instant; the implementation stays efficient enough that live comparison feels seamless as you type or paste.
Line diff vs word diff vs character diff
Diffs come at different granularities, and choosing the right one depends on what you are comparing. The three common levels are line, word and character:
| Granularity | Smallest unit | Best for |
|---|---|---|
| Line diff | A whole line | Code, config, structured docs, lists |
| Word diff | A single word | Prose edits, copywriting, proofreading |
| Character diff | A single character | Typos, codes, short strings, IDs |
This tool is a line-based diff, which is the most widely useful default and the same granularity Git and most code-review interfaces lead with. A line diff marks an entire line as added or removed the moment anything inside it changes. That is perfect for code and structured documents, where a line is a meaningful unit, and it keeps the output compact and easy to scan.
A word diff or character diff goes finer, highlighting the exact words or letters that moved within a line. That is better for prose where a single word changed in the middle of a long sentence — a line diff would show the whole sentence as removed-and-re-added, which is noisier. If you are comparing the length or structure of two drafts rather than the wording, pair this diff checker with the word counter to measure each version first.
Unified vs side-by-side diff views
There are two established ways to display a diff, and it helps to know both. A side-by-side (or split) view puts the original on the left and the changed version on the right, with changed lines aligned across the gap. It mirrors how you naturally compare two printouts and is excellent for wide screens and reviewing large structural changes.
A unified view, which this tool uses for its result, stacks everything into a single column, interleaving removed and added lines in place with their + and − markers. The input stays side by side so you can edit both versions comfortably, while the result is unified so the change reads top to bottom like a story. Unified diffs are compact, work beautifully on narrow and mobile screens, and are the format patches and pull requests are shared in — which is why they have become the default for sharing changes.
Ignore whitespace and ignore case
Not every difference is a meaningful one. Two toggles let you tell the diff checker which differences to ignore, so the signal is not buried in noise.
Ignore whitespace collapses runs of spaces and trims the ends of lines before comparing. This matters constantly in code, where reindenting a block or converting tabs to spaces changes every line without changing any logic. With the toggle on, a pure reformatting pass produces an empty diff, and only the genuine edits surface. It is just as useful for prose that has been re-wrapped or had double spaces cleaned up.
Ignore case treats “Hello” and “hello” as the same line. Turn it on when a capitalisation sweep — say, enforcing sentence case in headings — would otherwise flag dozens of lines you do not care about. Crucially, both toggles affect only what counts as a match: your original text is always displayed exactly as you pasted it, so you never lose the real formatting while filtering the comparison.
Common use cases for comparing text
A text compare tool earns its place across a surprising range of jobs. A few of the most common:
- Comparing drafts: see precisely what an editor or collaborator changed between two versions of an article, a proposal or an email, without re-reading the whole thing.
- Reviewing code: diff two versions of a function, a stylesheet or a config file to confirm a change does exactly what you intended and nothing more.
- Checking contracts and legal text: spot every clause that was altered between a draft and a counter-draft — a single inserted “not” can change everything, and a diff catches it.
- Tracking content versions: compare a page before and after an update to document exactly what shipped, or to roll back a specific change.
- Catching plagiarism or duplication: see how much of one text overlaps with another by how many lines come back as unchanged.
- Reconciling data exports: diff two CSV or config dumps to find rows that were added or dropped between runs.
In each case the value is the same: you replace slow, error-prone manual comparison with an instant, exhaustive one. People miss changes when they skim; an LCS diff does not.
Diff checkers and version control (Git)
If you have ever used Git, you have used a diff checker — it just lived inside the version-control system. When Git shows you the changes in a commit, a git diff, or the files in a pull request, it is running essentially the same LCS-based line diff this tool uses, then rendering the result in unified format with the familiar + and − markers.
The difference is scope. Version control tracks the full history of files in a repository and ties each diff to an author, a timestamp and a message. A standalone online diff tool like this one is for the many moments when the text is not in a repo: a paragraph a colleague emailed you, two snippets from a chat, a draft from a word processor, or output you pasted from a terminal. You get the same clarity Git gives developers, without needing to commit anything or set up a repository — just paste and compare.
How to compare two texts accurately
A few habits make diffs cleaner and more trustworthy:
- Put the older version on the left. Conventionally the Original is the “before” and the Changed is the “after”, so additions read as new work. If you pasted them backwards, just hit Swap.
- Match the line structure. Because this is a line diff, how the text breaks into lines affects the result. Comparing one long paragraph against the same paragraph split into sentences will show a bigger change than the wording warrants.
- Use the toggles deliberately. Turn on Ignore whitespace for reformatted code, and Ignore case for capitalisation sweeps — but leave them off when those details actually matter.
- Read the summary first. The additions and deletions counts tell you the size of the change before you dive into the lines, so you know whether to expect a tweak or a rewrite.
Privacy: why in-browser diffing matters
This diff checker runs entirely in your browser using JavaScript. Neither the original nor the changed text is sent to a server, stored or logged — the comparison happens on your own device, and the text never leaves it. That is not a minor detail for a tool like this. The documents people most want to compare are often the most sensitive: contracts under negotiation, unpublished manuscripts, internal reports, proprietary source code and legal drafts.
Any comparison tool that processes that text on a remote server is a place your words could be retained or exposed. In-browser diffing removes that risk entirely, which is why a privacy-respecting text difference checker is the safer default for anything confidential. You can work offline, close the tab, and leave nothing behind.
Text diff checker vs word counter
The two tools answer different questions about the same text. A diff checker tells you what changed between two versions; a word counter tells you how much there is in one version. In practice they pair naturally: measure each draft with the word counter to see how length moved, then run them through this comparison tool to see exactly which lines account for the difference.
Between them they cover the two things writers and editors ask most often during revision — is it the right length, and what actually changed. You will find both, alongside the rest of the utilities, on the free SEO tools index.
Paste your two versions into the comparison tool above to see every addition, deletion and unchanged line update the moment you type — no signup, no upload, and no limit on how often you compare.