Diff Checker
Compare two texts or files and see exactly what changed: added and removed lines, with the changed words highlighted, side by side or as a unified diff.
Compared in your browser; neither text is uploaded.
Related Developer Tools
This diff checker compares two versions of a text and shows what was added, removed and changed, line by line, with the changed words highlighted inside each line. Use it to compare two versions of a document or contract, check what changed in a configuration file, review code without a Git repository, or confirm that two files really are identical. Texts can be pasted, opened from your computer or loaded from a URL, and nothing is uploaded.
Reading the Result
| You see | It means |
|---|---|
| Red line, left side only | The line was removed |
| Green line, right side only | The line was added |
| Red on the left and green on the right | The line was edited; the darker highlight marks the changed words |
| โฏ Show N unchanged lines | Identical lines folded away; three lines are kept around each change for context |
+3 added โ1 removed 2 changed | Counts of lines in each group, above the comparison |
Line numbers refer to each text's own lines, so after an insertion the numbers on the two sides no longer match. That is expected and helps you find the same spot in each file.
Tips for Cleaner Comparisons
- Format JSON first. Two JSON files with the same data can be written on one line or in a different key order. Run both through the JSON formatter with sorted keys, then compare, and only real data changes remain.
- Re-indented code: turn on Ignore whitespace so moved indentation does not hide the lines that really changed.
- Prose and contracts: keep word highlighting on to see an edited word or number inside a long paragraph; switch to characters for typos and IDs.
- Windows and Mac line endings (CRLF and LF) are treated as the same, so a file saved on another system does not show every line as changed.
Unified Diff Format
The .diff download uses the standard unified format, which code review tools and patch understand:
--- config.old.yaml +++ config.yaml @@ -1,4 +1,4 @@ server: host: 0.0.0.0 - port: 8080 + port: 9090 timeout: 30
The @@ -1,4 +1,4 @@ line says the block starts at line 1 and covers 4 lines in each file. Lines starting with a space are unchanged context, - marks a removed line and + an added one.
Related Tools
Convert a YAML config to JSON before comparing it with the JSON to YAML converter, test a find-and-replace pattern with the regex tester, or check that two downloads are identical byte for byte with the hash generator.
Frequently Asked Questions
How do I compare two text files?
Use Open file above each box, or drop a file onto it, then read the differences below. You can also paste text, or load a file from a URL such as a raw GitHub link. The comparison updates as you type; for very large texts, a Compare button appears instead so typing stays smooth.
What do the colours mean?
Red lines exist only in the original text and green lines only in the changed text. A line shown in red on the left and green on the right was edited, and the darker highlight inside it marks the exact words or characters that changed. Unchanged stretches are folded; click Show unchanged lines to open them.
What is the difference between side by side and unified view?
Side by side puts the two versions in columns with their own line numbers, which is easiest to read on a wide screen. Unified view lists everything in one column with - before removed lines and + before added ones, like git diff, which suits phones and narrow windows.
What does Ignore whitespace do?
It treats lines as equal when they differ only in spaces or tabs: extra spaces between words, indentation and spaces at the end of a line. Use it when one version was re-indented or reformatted. Ignore case does the same for upper and lower case letters.
How do I make a patch file?
Press .diff to download the differences in unified diff format, the format used by git diff and diff -u, or open Show as unified diff to copy it. With GNU patch you can apply it to the original file: patch original.txt changes.diff.
Are my texts uploaded anywhere?
No. Both texts are compared by JavaScript in your browser, so contracts, code and configuration files with passwords never leave your device. Loading from a URL fetches the file straight into your browser.
How does the comparison work?
Lines are matched with the Myers algorithm, the default behind git diff, which finds the smallest set of added and removed lines. For two very different large files, where that search would take too long, the tool switches to patience diff, which lines up the lines that appear exactly once in both texts. Changed lines are then compared word by word or character by character.