What this tool does
Two texts in, a unified diff out.
version: 1 version: 2
name: demo name: demo
port: 8080 port: 8080
debug: true
@@ -1,3 +1,4 @@
-version: 1
+version: 2
name: demo
port: 8080
+debug: true
The comparison uses the Myers algorithm — the one behind git diff — so the result is the shortest set of changes rather than the first one found. Identical texts give an empty result, which is the answer you wanted.
Reading the output
@@ -1,3 +1,4 @@— where the change sits: three lines from line 1 on the left, four from line 1 on the right.-— the line is in the first text and not in the second.+— the line is in the second and not in the first.- A leading space — the line is unchanged, shown for context. Three lines of it on each side, as Git does by default.
When two identical-looking lines differ
-a
+a
Nothing to see, and yet they are not the same line. The usual suspects are a trailing space, a tab against spaces, and a Windows \r\n against a Unix \n — a file edited on two machines collects all three. The comparison reads the exact characters, so it reports a difference it cannot show you.
cat -A on Unix prints $ at the end of each line and ^M for a carriage return; most editors have a “show whitespace” switch. Either will make the difference visible in a second.
What it does not do
- Word-level highlighting. One changed character marks the whole line.
- Rename or move detection. A block moved elsewhere reads as a removal and an addition, not as a move.
- A three-way merge. This compares two texts; it does not resolve them.
- The
\ No newline at end of filemarker. A text that ends with a line break against one that does not shows as an added empty line, which is the same information in a plainer form.
Private by design
Everything runs locally in your browser with JavaScript. Your data is never uploaded, which makes the tool safe for sensitive content, and it keeps working offline.