How do I compare two blocks of text?
Paste the original version into the left box and the changed version into the right box. The comparison runs as you type: lines that were removed are shown in red on the left, lines that were added are shown in green on the right, and lines that were edited are lined up next to each other with the specific words that changed picked out.
Use 'Swap sides' if you pasted the two versions the wrong way round, and 'Inline' if you'd rather read the changes as a single running list instead of two columns.
What do the whitespace and case options do?
Ignore leading & trailing whitespace treats lines as identical even if their indentation differs. Ignore all whitespace goes further and ignores spaces and tabs anywhere in the line, which is useful when only formatting has changed. Ignore case treats upper and lower case letters as the same, so Value and value won't show as a difference.
These options only affect the comparison. The text shown in the results is always exactly what you pasted.
What is a unified diff?
A unified diff is the standard text format used by git diff, patch and code review tools. Each change is shown with a few lines of surrounding context, removed lines prefixed with - and added lines prefixed with +. 'Copy unified diff' puts that format on your clipboard so you can paste it into a pull request, a bug report or a .patch file.
Is my text sent anywhere?
No. The whole comparison happens in your browser using JavaScript. Nothing you paste is uploaded, logged or stored, so it's safe to use with private code, contracts, configuration files and anything else confidential.
How does 'Copy link' work?
'Copy link' packs both blocks of text and your current options into the page address itself, after the #. Opening that link reloads the same comparison. Because the text travels inside the URL and never touches a server, very long inputs can't be shared this way – you'll see a message if that's the case.
Can I compare two files?
Yes. Drag a text file straight onto either box and its contents will be loaded in. You can also open each file in a text editor and paste the contents across.
My input is minified onto one line
A line-by-line diff isn't much use when everything sits on a single line. Run each side through the JSON formatter first, or another beautifier for the language you're working in, then compare the tidied-up versions here.