How to compare two texts
- Paste the original on the left and the new version on the right, or use Open file or drag a file onto either box.
- The difference appears below as you type. Removed lines are red, added lines are green, and within a changed line the exact words that differ are highlighted.
- Switch to Unified for the compact view Git uses, or download a
.patchfile you can apply withgit applyorpatch -p0.
Lines, words or characters?
- Lines suits code, config files, CSV and logs, where each line is a unit.
- Words suits prose: articles, contracts and documentation, where a paragraph is often one long line.
- Characters finds tiny differences, such as a changed digit in an ID or a swapped letter.
Ignoring noise
Ignore whitespace hides changes that are only indentation or trailing spaces, which is useful after reformatting code. Ignore case treats SELECT and select as the same. Windows (CRLF) and Unix (LF) line endings are always treated as equal. Hide unchanged lines keeps three lines of context around each change so long files stay readable.
Comparing JSON or XML?
For structured data, a text diff reports changes caused by key order or formatting. The JSON & XML Compare tool compares the data itself and lists differences by path, such as $.items[2].price.
Frequently asked questions
Is my text uploaded to a server?
No. The comparison runs entirely in your browser, so it's safe for private code, contracts or logs. The last texts you compared are kept only in this browser.
How large can the files be?
Files up to 20 MB can be opened. Very large files with many scattered changes can take a few seconds; if a comparison takes longer than 5 seconds it is stopped and you are told.
What is a unified diff?
The format Git and the patch tool use: removed lines start with a minus, added lines with a plus, and a few unchanged lines around each change give context. Download it with the .patch button.
Why are two lines shown as different when they look the same?
They probably differ in invisible characters such as trailing spaces, tabs versus spaces, or a non-breaking space. Tick Ignore whitespace, or compare by characters to see exactly where.
Can I compare Word or PDF documents?
Copy the text out of the document and paste it here. The tool compares plain text, not formatting.