🔀 Dev Tool · v2.0 Advanced

Code Diff Checker

Unified · Split · Word-Level · Inline · 3-Way Merge · Char Diff · Live Auto-Diff · Export .patch / HTML

Ignore whitespace
Ignore case
Ignore blank lines
Wrap lines
Live diff
3-Way merge
Ctrl+Enter Compare
Ctrl+/ Search
Ctrl+S Copy diff
Tab Switch panels
Drag Drop files
Ctrl+E Export .patch
Ctrl+W Word view
Ctrl+3 3-Way merge
Original 0 lines
Modified 0 lines
Base
Version A
Version B
0added
0removed
0unchanged
0chunks
0old
0new
0words changed
Similarity
0%
Diff Output
↑ Paste code in both panels and click ⚡ Compare
Or press Ctrl+Enter · Enable Live Diff to auto-compare as you type
Added
Removed
Unchanged
Underline = char/word-level change
KJSynthora is free forever — support keeps it going
If this tool saved you time, consider buying Jhashuva a coffee ☕

How to Compare Code

1

Paste or Upload

Paste code into both panels, or drag & drop files. Any language works — JS, Python, HTML, SQL and more.

2

Set Options

Choose context lines, toggle ignore whitespace/case/blank lines for cleaner, more focused diffs.

3

Choose View Mode

Unified, Split (side-by-side), Word-level, Inline, or 3-Way merge — pick what works best for your use case.

4

Live Auto-Diff

Enable Live Diff — comparison updates automatically as you type, with no need to click Compare.

5

Search & Navigate

Press Ctrl+/ to search within the diff. Use ↑↓ to jump between matches.

6

Export

Export as standard .patch file (for git apply), or as an HTML report for sharing and documentation.

Code Diff Guide

📅 June 2025⏱️ 7 min read✍️ KJSynthora

How to Compare Code Files Online — Complete Diff Guide 2025

Whether you're reviewing a pull request, debugging a regression, comparing config files, or checking what changed in a deploy — understanding code differences is a core developer skill. This guide covers all five diff view modes, when to use each, and how to interpret results like a senior engineer.

The 5 Diff View Modes — When to Use Each

  • Unified view: All changes in a single column with +/- prefixes. Standard git diff format. Best for reading long diffs, creating patch files, posting in GitHub issues.
  • Split view: Original left, modified right, aligned row-by-row. Best for complex changes where you need side-by-side visual comparison.
  • Word-level diff: Highlights individual words that changed, not entire lines. Best when lines are mostly similar — a renamed variable, changed parameter, or updated value.
  • Inline diff: Like unified but with added/removed content shown inline on the same row. Best for spotting small changes quickly without switching rows.
  • 3-Way merge: Shows base + version A + version B simultaneously. Best for resolving merge conflicts when two branches diverged from a common ancestor.
💡 Pro tip: Use "Ignore whitespace" when comparing reformatted or re-indented code — it filters pure whitespace changes so you only see semantically meaningful differences. Use Word-level view after identifying a changed line to see exactly which token changed.

Understanding Char-Level and Word-Level Highlighting

When this tool detects that a deleted line and an inserted line are similar (a modification rather than a complete replacement), it performs deeper analysis: character-level diff highlights the exact characters that changed within those lines. Word-level view goes further — it treats the entire text as a sequence of words and shows which words were added, removed, or kept.

Using 3-Way Merge for Git Conflict Resolution

Paste the common ancestor (base) in the middle panel, your branch changes in Version A, and the other branch in Version B. The diff engine detects where both branches changed the same region — these are your conflict zones, highlighted in yellow. This gives you the full context needed to manually resolve the conflict correctly.

Exporting and Using .patch Files

A .patch file is a standard unified diff that can be applied directly to a codebase using git apply changes.patch or patch -p1 < changes.patch. This makes the tool useful for sharing code changes without access to a shared repository — useful for open-source contributions, code reviews via email, or applying hotfixes to production servers.

More Dev Tools

Frequently Asked Questions

How do I compare two code files online?
Paste the original code in the left panel and the modified code in the right panel, then click ⚡ Compare or press Ctrl+Enter. Added lines appear green, removed lines red, with char-level highlighting for changed lines.
What is word-level diff and when should I use it?
Word-level diff highlights individual words that changed within a line rather than marking the entire line. Use it when lines are mostly similar — for a renamed variable, changed parameter value, or updated URL. It makes small inline changes trivial to spot.
What is 3-way merge?
3-way merge shows three versions simultaneously — the original base, version A, and version B — allowing you to see how two branches diverged from a common ancestor and identify conflict zones where both branches changed the same code region.
What programming languages are supported?
The tool works with any plain text — JavaScript, TypeScript, Python, HTML, CSS, JSON, SQL, Java, C++, Go, Rust, Shell, YAML, Markdown and more. The language selector is for labeling; the diff algorithm works on raw text.
What does the similarity score mean?
The similarity score is the percentage of lines that are identical between the two files. 100% means the files are identical, 0% means completely different. It's calculated as (matching lines × 2) / (total lines in both files).
Can I upload files instead of pasting?
Yes. Click the Upload (📁) button on either panel, or drag and drop files directly onto the editor areas. Files are processed entirely in your browser — nothing is sent to any server.
What is Live Diff mode?
When Live Diff is enabled, the comparison updates automatically as you type — without needing to click the Compare button. There is a short debounce delay (600ms) to avoid re-running on every keystroke.
Can I export as a .patch file?
Yes. Click Export .patch to download a standard unified diff file. This can be applied to a codebase using git apply changes.patch or patch -p1 < changes.patch.