| Mode | Granularity | Best for |
|---|---|---|
| Line | Entire lines | Source code, config files, log comparison |
| Word | Individual words | Prose, documentation, markdown |
| Character | Single characters | Typos, invisible chars, encoding differences |
The unified diff format is the standard output format used by Git, patch utilities, and code review tools. Lines starting with + were added, lines starting with - were removed, and lines without a prefix are unchanged context.
@@ -1,4 +1,4 @@
function greet(name) {
- console.log("Hello, " + name + "!");
+ console.log(`Hello, ${name}!`);
return true;
}Paste the original text into the left panel and the revised version into the right panel. Select the comparison mode for the detail you need, then compare the inputs. The example below uses line mode to show one deleted line and one added line. Read the markers as well as the highlighting so you can distinguish an addition from a removal without depending on color alone.
Use word or character mode when a whole changed line hides a small edit inside a sentence. A text comparison does not understand programming language semantics, so two equivalent expressions can still differ. Conversely, ignore options can deliberately hide whitespace or case changes. Start with those options disabled when auditing an exact edit, and retain the original files separately from the comparison display.
Left: old
Right: new
Line diff:
-old
+new
A diff (difference) shows what changed between two versions of a text. Lines prefixed with + are additions (in green), lines prefixed with - are deletions (in red), and unchanged lines are shown without a prefix. Diffs are the foundation of version control systems like Git.
Line diff compares entire lines and is best for code and prose. Word diff highlights individual words that changed within a line, useful for detecting small edits in paragraphs. Character diff shows every single character change, ideal for finding typos, invisible characters, or encoding differences.
Paste the original content in the left panel and the modified content in the right panel, then click Compare. The highlighted diff shows exactly what changed. Use Line mode for code, Word mode for prose, or Character mode for fine-grained inspection.
Comparison runs locally in your browser. This interface does not offer account saving or server sharing. Copying the marked diff uses your clipboard, so check where you paste it afterward. Keep the original documents separately if you need to return to them later; the comparison display is not a permanent backup of your source files.