Diff checker
A diff checker lines up two blocks of text and marks what was added and removed. This one compares them in your browser at line, word or character granularity, so neither version is uploaded. Unchanged blocks can collapse, you can jump to the next change, and the table says when it is showing only the first 200 rows.
Two versions
lines changed
- Added
- ·
- Removed
- ·
- Unchanged
- ·
- Network requests
- ·
- Our own script
- ·
Was this tool useful?
Characters this page names
When a changed line differs by one of these characters, the page names it beneath that line, for the first 10 such lines. This is the set this page names, not every character that exists.
| Codepoint | Name | Class |
|---|---|---|
| U+0009 | CHARACTER TABULATION † | whitespace |
| U+0020 | SPACE | whitespace |
| U+00A0 | NO-BREAK SPACE | whitespace |
| U+1680 | OGHAM SPACE MARK | whitespace |
| U+2000 | EN QUAD | whitespace |
| U+2001 | EM QUAD | whitespace |
| U+2002 | EN SPACE | whitespace |
| U+2003 | EM SPACE | whitespace |
| U+2004 | THREE-PER-EM SPACE | whitespace |
| U+2005 | FOUR-PER-EM SPACE | whitespace |
| U+2006 | SIX-PER-EM SPACE | whitespace |
| U+2007 | FIGURE SPACE | whitespace |
| U+2008 | PUNCTUATION SPACE | whitespace |
| U+2009 | THIN SPACE | whitespace |
| U+200A | HAIR SPACE | whitespace |
| U+202F | NARROW NO-BREAK SPACE | whitespace |
| U+205F | MEDIUM MATHEMATICAL SPACE | whitespace |
| U+3000 | IDEOGRAPHIC SPACE | whitespace |
| U+200B | ZERO WIDTH SPACE | zero width |
| U+200C | ZERO WIDTH NON-JOINER | zero width |
| U+200D | ZERO WIDTH JOINER | zero width |
| U+2060 | WORD JOINER | zero width |
| U+FEFF | ZERO WIDTH NO-BREAK SPACE | zero width |
| U+00AD | SOFT HYPHEN | format |
| U+2028 | LINE SEPARATOR | line terminator |
| U+2029 | PARAGRAPH SEPARATOR | line terminator |
| U+0430 | CYRILLIC SMALL LETTER A | homoglyph |
| U+0435 | CYRILLIC SMALL LETTER IE | homoglyph |
| U+043E | CYRILLIC SMALL LETTER O | homoglyph |
| U+0440 | CYRILLIC SMALL LETTER ER | homoglyph |
| U+0441 | CYRILLIC SMALL LETTER ES | homoglyph |
| U+0445 | CYRILLIC SMALL LETTER HA | homoglyph |
| U+0455 | CYRILLIC SMALL LETTER DZE | homoglyph |
| U+0456 | CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I | homoglyph |
| U+03BF | GREEK SMALL LETTER OMICRON | homoglyph |
| U+037E | GREEK QUESTION MARK | homoglyph |
| U+2010 | HYPHEN | homoglyph |
| U+2011 | NON-BREAKING HYPHEN | homoglyph |
| U+2012 | FIGURE DASH | homoglyph |
| U+2013 | EN DASH | homoglyph |
| U+2014 | EM DASH | homoglyph |
| U+2015 | HORIZONTAL BAR | homoglyph |
| U+2018 | LEFT SINGLE QUOTATION MARK | homoglyph |
| U+2019 | RIGHT SINGLE QUOTATION MARK | homoglyph |
| U+201C | LEFT DOUBLE QUOTATION MARK | homoglyph |
| U+201D | RIGHT DOUBLE QUOTATION MARK | homoglyph |
† Formal alias from Unicode NameAliases.txt. U+0009 has no Unicode Character Database name.
What a mark is, at each granularity
The rows are always line pairs, and the tally is always in changed lines. Granularity
only changes the marks inside a changed pair. Line marks the whole line. Word extends
each differing run out to whitespace-delimited tokens, so cat versus
cot marks both words. Character marks the same runs without that
extension, so only a and o light up.
Treat both sides as JSON is one checkbox: parse and sort keys together, or not at all. If a side does not parse, the checkbox stays on, a notice says key sorting is off, and the comparison still runs as plain text.
The table says when it is truncated
Collapse unchanged lines, on by default, keeps three lines of context around each change and replaces the rest with one gap row. After that, the table renders at most 200 rows. When there are more, the notice above the table names the uncapped row total. Copy as a diff and the added/removed tally still cover every line.
The diff checker lines the two sides up by longest common subsequence, not by
position, so a one-line insert shows as one added line rather than every line below
it changing. With Treat both sides as JSON ticked, a __proto__ key is
compared like any other key, so two documents that differ only there still show the
difference.
Share links carry both versions and every toggle in the URL fragment, after the
#. Browsers do not send a fragment in a request, so the payload does not
reach a server. Open a file reads a local text file into that side's box; a non-text
type and a file over 5 MB each have their own error line, and the type check runs
first.
Questions
How do I compare two text files?
Use Open a file on each side, or paste into the two boxes. The left is the original and the right is the new version. Each file can be up to 5 MB, and it's read in this tab, never uploaded. Added, removed and changed lines are marked, with line numbers for both sides.
Can it show the differences side by side?
Yes. Each row pairs a line from the left with its match on the right. Granularity decides what gets highlighted in a changed pair: the whole line, whole words or single characters. Compare cat with cot. Word marks both words, and Character marks only the a and the o.
Can it compare large files?
Up to 5 MB per file and 20,000 lines per side. In a browser without Web Worker support, the limit is 2,000 lines. The table draws at most 200 rows and says so when it stops. Copy as a diff and the added and removed counts still cover every line.
Can it ignore spaces?
Partly. Ignore whitespace differences drops whitespace at the start and end of each line and treats any run of whitespace, including tabs, as one space. It doesn't remove spaces entirely, so a b and ab still count as different. Blank lines still count too, unless you also turn on Ignore blank lines.
Does it compare line endings?
Only when you use Open a file on both sides and haven't edited either box since. If one file ends its lines with CARRIAGE RETURN then LINE FEED (U+000D U+000A) and the other with LINE FEED (U+000A), the page says so at the top of the results, even when it finds no other differences. Text pasted into the boxes can't be checked: the browser turns every line ending into a LINE FEED before the page sees it.
Can it compare two JSON files?
Yes. Open a .json file on each side, or paste, and turn on Treat both sides as JSON and sort their keys first. Keys are sorted at every level, so two objects that differ only in key order match. Arrays keep their order, so [1,2] against [2,1] still shows a change. If a side won't parse, a notice says so and the compare runs as plain text.
Is either version uploaded?
No. Both versions stay in this tab and the comparison runs here. Open a network tab and paste into both boxes: no request carries what you pasted. Before any update to this page goes live, an automated check types into both boxes and presses every button, and blocks the update if what it typed turns up in a request. How that works is in how we build tools.
Related tools
If both sides are JSON and you want the sorted document for something else, the JSON formatter does the same normalizing on its own. If one side needs decoding first, run it through base64 or URL decoding, or chain the whole sequence at the tool chain.