Diff Checker
Paste two versions and see exactly what changed, line by line and word by word.
- Free
- No sign-up
- Runs in your browser
0 lines
0 lines
Compared on your device — nothing is uploaded. Drop or open text and code files of up to 20 MB.
Differences
Paste two versions above to see what changed.
Removed lines are marked −, added lines +, and the changed words are highlighted.
How the diff checker works
The checker splits both texts into lines and finds the longest run of lines they share, in order — the longest common subsequence — using Eugene Myers’ diff algorithm, the same idea behind git diff. Every line outside that shared run was either removed from the original (−) or added in the changed text (+). When a removed line and an added line are similar, they are shown side by side as one changed line, and the exact words (or characters) that differ are highlighted.
For example, compare “apple / banana / cherry” with “apple / banana split / cherry / date”. The longest shared run is “apple … cherry” (2 lines), so the result is 1 changed line (banana → banana split, with “ split” highlighted) and 1 added line (date). As a unified diff — the format git and patch read — that is:
--- a/original.txt +++ b/changed.txt @@ -1,3 +1,4 @@ apple -banana +banana split cherry +date
What “ignore whitespace”, “ignore case” and “ignore blank lines” do
Ignore whitespace treats two lines as equal when they differ only in spaces or tabs — re-indented code or “if(x)” versus “if (x)” no longer shows up. Ignore case makes “Hello” and “hello” equal. Ignore blank lines leaves out lines that are empty or hold only spaces, so adding or removing spacing between paragraphs doesn’t count as a change. The copied .diff follows the same choices, just like diff -w.
Why does a moved line show as removed and added?
A line diff only describes removals and additions, so a line that moved is removed in one place and added in another. The checker spots these and labels both ends “moved”, so you can tell a reordered line from a new one.
Windows (CRLF) vs Unix (LF) line endings
Files saved on Windows end each line with two characters (CRLF), while macOS and Linux use one (LF). The checker treats them as the same and tells you when the two texts use different endings. A missing newline at the very end of a file is reported as a change, because it changes the file — the line is marked “no newline at end”.
Frequently asked questions
- Is my text uploaded anywhere?
- No. Both texts are compared in your browser, in a background thread, and nothing is sent to a server or saved.
- How large can the files be?
- Files up to 20 MB can be opened. Texts with tens of thousands of lines compare in well under a second on a typical laptop; long unchanged stretches are folded so the result stays easy to scroll.
- How do I apply the downloaded .diff file?
- It’s a standard unified diff. Run “patch original.txt < changes.diff” in a terminal, or “git apply” inside a repository after renaming the paths in the first two lines to your file’s path.
- What’s the difference between word and character highlighting?
- Words highlights whole words that changed, which reads best for prose and code. Characters highlights single letters, which is handy for spotting a typo, such as “colour” versus “color”.