Code Diff
Free online code diff tool, no installation required
About Code Diff
Compares two text snippets line by line and highlights added, removed, and unchanged lines, with counts of additions and removals. Results can be viewed inline (single column with +/- prefixes) or side-by-side (original left, modified right), and copied as a unified-diff-style text block.
How to Use
1. Optionally pick a Language button - this is purely a label for your reference; it does not perform syntax-aware diffing. 2. Paste the original text in the Original Code box and the new text in Modified Code. 3. Click Compare to compute the diff. 4. Toggle Inline View or Side-by-Side View. 5. Click Copy to copy the diff text (lines prefixed with '+', '-', or space), or Clear to reset.
Diff Algorithm & Limitations
The diff is a simple line-by-line walk, not a true Longest-Common-Subsequence or Myers diff. When two corresponding lines differ, both are emitted as a removed+added pair; pure insertions and deletions are detected, but block moves or reorderings are not matched and will appear as a full remove-then-add. There is no whitespace-ignore or syntax-aware comparison despite the language selector.
▶Does the Language selector change how the diff works?
▶Why are some unchanged lines shown as changed after reordering?
▶Can I ignore whitespace changes?
▶What format is produced by Copy?
If this tool has been helpful to you, consider buying me a coffee.
Buy me a coffee