Differences
This diff checker compares two texts or files and highlights every difference: removed lines in red, added lines in green and the changed words inside each line. View it inline or side by side, ignore case or whitespace, and copy the result as a unified diff patch. Works for code, config files, contracts and any plain text.
How to use
- Paste the original text on the left (or top) and the changed text on the right, or drop a file onto each box. Drop two files at once to fill both.
- Differences appear as you type: removed lines in red, added lines in green, and changed words highlighted inside each line.
- Choose Inline or Side by side, and highlight by lines, words or characters. Ignore case or spaces to hide noise.
- Copy the unified diff (patch) or download it as a .diff file to share or apply with git.
- Unchanged stretches are folded to 3 lines of context; tap a fold to expand it.
- Side by side becomes a stacked view on narrow screens: each removed line sits right above its replacement.
- Large files (several MB) are compared in a background thread, so typing stays smooth.
- Nothing is uploaded: both texts stay in your browser.
How the comparison works
The tool uses the same kind of algorithm as git: it finds the longest stretch of lines both versions share and reports the smallest set of insertions and deletions that turns the original into the changed text. Inside a changed line it runs a second comparison by word or character, so a single edited number stands out instead of the whole line.
Unchanged parts are folded to three lines of context, the same default as git diff, and you can jump from change to change with J and K.
Reading a unified diff
The copied patch uses the unified format: lines starting with - were removed, lines starting with + were added, and a header such as @@ -12,4 +12,5 @@ means the hunk starts at line 12 and covers 4 lines in the old file and 5 in the new one. You can save it as a .diff file and apply it with git apply or patch.
Ignore whitespace hides changes in indentation and trailing spaces, which is useful after reformatting code. Ignore case treats Hello and hello as equal.
Frequently asked questions
How do I compare two text files?
Drop one file on each box, or drop both at once to fill both sides. The differences appear immediately; no upload or button press is needed.
Can I see only the words that changed?
Yes. Choose word or character highlighting and the changed parts are marked inside each line, while unchanged text stays plain.
Can I compare large files?
Yes. Files of several megabytes are compared in a background thread so the page stays responsive, though very long lines are slower to compare by character.
Can I use the result with git?
Yes. Copy or download the unified diff and apply it with git apply or the patch command in the folder that holds the original file.
Are my files uploaded?
No. Both texts are compared in your browser and never leave your device, so it is safe for private code and documents.