Compare two code snippets with word-level diff highlighting. Supports any language. Runs in your browser.
Paste two code snippets and click Compare. The tool compares line by line, then highlights the specific tokens that changed within modified lines. Additions are shown in green, deletions in red.
The tool first compares code line by line using the LCS (Longest Common Subsequence) algorithm — the same approach used by git. When it finds a deletion paired with a nearby addition, it performs a token-level diff to highlight exactly which parts of the line changed.
The diff is language-agnostic — it works with any text-based code: JavaScript, Python, TypeScript, HTML, CSS, JSON, SQL, Go, Rust, Java, C/C++, and any other language or config format.
Yes — enable "Ignore whitespace" to skip indentation and spacing changes and focus on meaningful code changes only. You can also ignore case differences.
Similar concept. This tool uses the same LCS algorithm as git diff but adds visual word-level highlighting within changed lines, making it easier to spot exactly what changed.
No. All comparison runs locally in your browser using JavaScript. Nothing is sent to any server. Your code never leaves your device.