Diff Checker
Diff Checker compares two blocks of text and highlights everything that changed between them, by line, by word or by character. It is useful for spotting an edit between two drafts, two config files or two versions of a function — and nothing you paste leaves your browser.
Runs entirely in your browser — nothing you enter is uploaded.
TextA line that changed shows as a removal plus an addition — a diff only knows "same" or "different", not "edited". Word mode is usually the readable one for prose; line mode for code and config.
About comparing text
A diff finds the longest sequence of content that appears in both texts in the same order and treats everything else as added or removed. That single rule explains the output that surprises people: a paragraph you moved shows as a deletion in its old place and an addition in its new one, because its positions disagree about the order. A line you edited shows as a removal plus an addition too — to the algorithm, the old and new lines are simply different lines.
Line mode is right for code and configuration; word mode is far more readable for prose, where a one-word change would otherwise flag an entire paragraph. Character mode is the one to reach for when two texts look identical but compare as different, which is almost always invisible characters — Windows line endings against Unix ones, a trailing space, or a non-breaking space pasted from a web page.
Common questions
- Why is text I only moved shown as deleted and added?
- Because a diff only recognises content that appears in both texts in the same order. A block you moved cannot be part of that common sequence, since its position contradicts the order, so it is reported as removed where it was and added where it now is. The comparison has no concept of the same text appearing elsewhere.
- Two files look identical but every line is marked as changed. Why?
- Almost always invisible characters, and usually line endings: Windows ends a line with a carriage return and a line feed, Unix with a line feed alone, so text that has travelled between the two differs on every line by a character with no glyph. Trailing spaces, tabs against spaces, and non-breaking spaces pasted from a web page do the same. Character mode shows exactly where.
- When should I use word mode instead of line mode?
- Use word mode for prose. In line mode a paragraph is a single line, so correcting one word marks the whole paragraph as removed and re-added, which tells you nothing. Word mode highlights just the word that changed. Line mode is better for code and configuration, where the line genuinely is the unit you edit and review.
- What is the unified diff that the copy button produces?
- It is the standard patch format that version control tools read and write. Removed lines are prefixed with a minus and added lines with a plus, grouped under headers giving the line numbers they apply at, with a few unchanged lines of context around each change. It can be pasted into a code review or applied mechanically to reproduce your edit.