Written by Alex Chen Β· Reviewed by Jane Smith Β· July 29, 2026
Compare two blocks of text and see every addition, deletion, and unchanged line at a glance.
A diff highlights every difference between two versions of text, whether that text is source code, configuration, or prose. The tool lines up both inputs, marks the lines that were removed in red, marks the lines that were added in green, and leaves identical lines neutral. Scanning the result tells you at a glance what changed without reading both documents in full.
Imagine an API settings block that gained a retry policy between releases. The old version had two retries and a ten-second timeout; the new version allows five retries and a thirty-second timeout, while the endpoint address stayed fixed:
- retries: 2 - timeout: 10000 + retries: 5 + timeout: 30000 url: https://api.example.com
The first two lines are flagged as deleted, the next two as added, and the endpoint line is marked unchanged. The stats row confirms 2 additions and 2 deletions, so you know exactly how big the edit really was.
Behind the scenes the comparison builds a matrix of the two texts and finds the longest sequence of lines that appears in both, in the same order. Everything outside that common core is treated as a deletion from the first input or an addition to the second. The algorithm is dynamic programming, which guarantees a minimal set of differences rather than a heuristic guess.
Added lines sit on a pale green background, deleted lines on pale red, and unchanged lines on gray. Line numbers on both sides keep the coordinates traceable back to your original inputs, which is especially useful when you paste in two files that started with different headings or spacing.
Above the panels, a summary line tallies the changes: the number of added lines, removed lines, and the total lines compared. The count is a useful gate before you commit to a merge, because a surprise spike in deletions usually means the edit landed in the wrong place. Comparing the stats against the visual highlight keeps the two views consistent.
A line that looks identical can still differ in invisible ways: trailing spaces, tabs versus spaces, or a final newline. The checker treats the text byte for byte, so those subtle edits surface as real changes instead of being smoothed over. If a diff shows an unexpected deletion and addition where nothing seems different, whitespace is the usual culprit.
Reformatting a file, such as running a formatter over the whole codebase, creates a diff where every line looks changed even though only indentation moved. If that noise hides the real edit, compare the pair with whitespace stripped to see the substantive changes first, then review the formatting pass separately. Keeping the two steps apart turns a wall of red and green into a readable story.
The left panel is the baseline and the right panel is the revision, but swapping them reverses the colors: what was added becomes a deletion and vice versa. That matters when you paste two files and realize the order is wrong. The tool does not care which side you call the original, so flip the inputs instead of re-reading the output.
Moving a block of lines from one place to another shows up as a deletion at the old location and an addition at the new one, which can make a simple cut-and-paste look like a large rewrite. Read the two hunks together before judging the size of the change: identical text appearing on both sides is the signature of a move, not a rewrite. When the same block vanishes in one spot and appears in another, the edit is usually smaller than the line counts suggest.
Long files are processed in the browser without being sent anywhere. The dynamic-programming matrix grows with the product of the two lengths, so extremely large documents may take a moment, but typical config files, scripts, and essay drafts compare instantly. For very big inputs, narrowing the paste to the section you are revising keeps the display readable.
Both input panels and the generated result stay on this page. Nothing you paste is uploaded, logged, or stored, so you can safely diff proprietary code, private notes, or anything else you would not want to post on the internet. Reload the page and the panels clear, ready for the next pair of documents.