Diff Checker
Compare two texts side by side and see the differences
Seeing exactly what changed
Diffing sits under every code review, every merge, every audit of a changed config. The tool takes two blocks of text and shows added lines in green, removed lines in red, and untouched context in plain, then highlights the changed words inside lines that only shifted a little.
Line-level, then word-level
The line-level pass marks each whole line as added, removed, or unchanged, which is fast and works on any text. The word-level pass kicks in when a removed line aligns against an added one, marking only the words that changed, which reads far better for a typo fix or a renamed variable. The pairing uses the same longest-common-subsequence idea git relies on, so the output should feel familiar.
Large inputs and their limit
The comparison first trims the lines both texts share at the start and end, then runs the O(N*M) table only on the changed middle. That middle is the real limit: past about four million cells, roughly a 2,000 by 2,000 line changed region, the tool refuses the diff and shows a notice that the texts are too large to compare, rather than freezing the tab. Two mostly similar files of many thousands of lines still work, since the shared parts trim away, but two dissimilar texts of a few thousand lines each get refused. A command-line diff or a desktop app like Beyond Compare suits those better.
Diff questions
- Can it ignore whitespace?
- No. Whitespace counts, so a tab against four spaces shows as a change. When indentation style is the only real difference, normalize both sides in your editor first, say by converting tabs to spaces, then paste.
- Why is a block of seemingly identical text marked as changed?
- Usually an invisible character: a tab versus a space, or a non-breaking space pasted from a word processor. The word-level highlight marks the exact segment that differs, which points at the culprit. Line endings are the one thing the tool normalizes, so CRLF against LF never shows as a change.
- Can I diff JSON cleanly?
- Line diffing gets noisy on structured data, since reordered keys make a whole block look changed. Sort the keys on both sides first, or use a tool that compares the parsed structure.