📑 Code Diff Viewer

Compare code with syntax highlighting, character-level diffs, and multiple view modes. All client-side.

Last updated: November 8, 2026 · By the BoltQuickTools team

Compare two versions that are not in a repository

A config file copied from a server, a snippet from a chat message and the version on your disk rarely sit in the same Git history. Paste both here and you get a coloured diff without creating a repository or opening an editor.

Steps

  1. Paste into Original and Modified. Sample Data fills both with a short demo.
  2. Pick the language from the dropdown. It controls colours only and has no effect on what counts as changed.
  3. Tick Ignore whitespace or Ignore case if you need them, then click Compare.
  4. Switch between Side-by-Side, Unified and Inline. Unchanged lines more than three away from a change are folded behind a bar you can click to open.
  5. Copy Patch copies the result in unified diff form.

Example

Put five lines, const a = 1; through const e = 5;, each ending in a newline, into Original, and the same text with const b = 20; into Modified. The bar reports +1 addition, -1 deletion and 5 unchanged, and Copy Patch gives:

--- original
+++ modified
@@ -1,6 +1,6 @@
 const a = 1;
-const b = 2;
+const b = 20;
 const c = 3;
 const d = 4;
 const e = 5;
 

A changed line counts as one addition and one deletion. Within it, the characters that differ get a brighter highlight.

Things to watch for

How is this different from the text diff page?

Both compare line by line with the same kind of algorithm. The text diff checker highlights changed words and suits prose. This one adds syntax colours, three layouts and patch output. If you are comparing JSON where key order should not matter, the JSON diff compares structure, which a line diff cannot do.

Why does identical input show no "identical" message?

You get +0 additions, -0 deletions and a single folded bar such as 3 unchanged lines. That is the signal that the two inputs match.

Does my code get uploaded?

The comparison runs in this page's JavaScript, and the tool's code makes no network request with your text. Apart from the tool, the page requests Google web fonts and the site's analytics script, plus ad scripts if you accept them.