How to Use DiffMergy

A complete visual guide to mastering every feature of the platform

1. Code Compare

Step 1

Open the Compare Tool

Navigate to Code Compare from the main menu or visit diffmergy.com directly. The compare tool is the flagship feature of DiffMergy.

Step 2

Add Your Code

Paste your baseline code in the Original editor and the modified version in the Modified editor. You can also upload files directly or fetch code from a URL.

Step 3

Select Language & Compare

Choose your programming language from the dropdown (30+ supported), set your indent preference, and click Compare or press Ctrl+Enter.

Step 4

Review & Merge

Navigate between changes using the prev/next arrows (F2 / Shift+F2). Accept or reject each change individually, or use Accept All / Reject All. The merged result appears in the right panel.

2. View Modes

Side-by-Side View

Default view showing original and modified code next to each other. Ideal for understanding context around changes.

Unified View

Single-column diff view similar to git diff. Best for reviewing changes in a compact format or exporting patches.

Changes Only Filter

Toggle Changes Only to hide unchanged lines and focus solely on additions, removals, and modifications.

3. Keyboard Shortcuts

Ctrl+KCommand palette
Ctrl+EnterRun comparison
F2Next change
Shift+F2Previous change
Ctrl+ZUndo last decision
Ctrl+YRedo decision
?Show shortcuts help
EscapeClose modals

4. Save & Share Sessions

Save Session

Click Save to store your current comparison in your browser's local storage. Sessions are saved automatically every 30 seconds and before the page closes.

Load Session

Click Load to restore a previously saved session. All code, language settings, and diff decisions are preserved.

Share Link

Click Share to generate a URL-encoded link that contains both code snippets. Share it with teammates for instant comparison without any server storage.

5. Command Palette

Step 1

Open the Palette

Press Ctrl+K (or Cmd+K on Mac) on any page. A search box appears over the current screen.

Step 2

Search and Run

Type to fuzzy-search every tool and action — for example json, theme, or 3-way. Use the arrow keys to move, press Enter to run, and Esc to close. On the Compare page it also exposes Compare, Swap, Clear, Save, Share, Export patch, and next/previous change.

6. Three-Way Merge

Step 1

Switch to 3-Way Mode

In the Merged Result panel, click the 3-way button. A new Common ancestor (base) editor appears.

Step 2

Provide Base, Ours, Theirs

Paste the common ancestor version into the base editor. The Original editor is treated as ours and the Modified editor as theirs. Existing lines that only one side changed are merged automatically.

Step 3

Resolve Conflicts

When both sides change the same lines differently, DiffMergy writes standard <<<<<<< OURS / ======= / >>>>>>> THEIRS markers and shows the conflict count. Use Markers, Keep Ours, or Keep Theirs to view or auto-resolve them.

7. The Code Editor

Real Editor, Not a Text Box

Every pane uses a full CodeMirror 6 editor with line numbers, code folding, bracket matching, auto-indent, multi-cursor editing, and undo/redo. Syntax highlighting covers 30+ languages and matches the active theme.

Inline Change Highlighting

After comparing, changed lines are tinted directly in the editor and the exact added or removed words are highlighted, so you can see the change in context. Very large files are rendered with virtualization to stay responsive.

Appearance

Open Settings to change the editor font size and toggle word wrap. Both apply instantly to all editors. Keyboard options include Tab to indent, Shift+Tab to outdent, and Ctrl+F to search.

8. Other Tools

Code Review

Upload source files or entire folders to get instant static analysis: code smells, security vulnerabilities, refactor suggestions, and a health score. Try Code Review →

Security Scan

Paste any code to detect XSS, SQL injection, hardcoded secrets, eval() usage, and other OWASP vulnerabilities. Try Security Scan →

HTML Viewer

Paste HTML, CSS and JavaScript to render it live in a secure sandboxed preview. Optional script execution, responsive width presets, and one-click copy or download. Try HTML Viewer →

Developer Utilities

JSON/YAML tools, regex tester, encoding/decoding, hash generators, JWT decoder, password generator, minifier, and more. All browser-based, no server required. Explore all tools →

9. Tips for Best Results

Use Language Selection

Always select the correct language for your code. This enables syntax highlighting in the preview panel and improves diff accuracy for language-specific structures.

Ignore Whitespace

Enable the Ignore Whitespace option when comparing code that may have different indentation styles. This prevents false-positive changes from showing up.

Use the Minimap

The diff minimap in the bottom-right of the diff panel gives you an overview of where changes are concentrated in large files. Click to jump to a specific region.

Export Patches

Use the Export .patch button to download a standard unified diff file that can be applied with git apply or patch command.

Why Use DiffMergy’s Developer Toolkit?

DiffMergy’s comprehensive guide walks you through every feature of the platform, from basic code comparison to advanced merge workflows, session management, and keyboard shortcuts. Whether you are a first-time user or a power user exploring advanced features, this guide has you covered.

Each section includes step-by-step instructions with practical examples. The guide itself runs entirely in your browser alongside the tools, so you can learn by doing without switching between tabs.

100% Private — No Server Upload

All processing happens entirely in your browser using modern browser APIs. Your sensitive source code, credentials, and files never leave your device — no servers, no databases, no tracking, no sign-up required.

Fast & Reliable

Built with vanilla TypeScript and a lightweight custom engine, DiffMergy delivers sub-millisecond processing with zero network latency. The entire toolkit works on any modern browser across all operating systems, with no installation or setup needed.

Frequently Asked Questions

How do I accept or reject individual changes?

In the Diff Review panel, each changed line has Accept and Reject buttons. Click Accept to apply a change to the merged result, or Reject to keep the original version. You can also use Accept All or Reject All for bulk actions.

What keyboard shortcuts are available?

Ctrl+Enter to compare, F2 for next change, Shift+F2 for previous change, Ctrl+Z to undo, Ctrl+Y to redo, and ? to open the full shortcuts reference. Press Escape to close modals.

How do I share a comparison with my team?

Click the Share button after running a comparison. A compressed URL containing both code snippets is copied to your clipboard. Anyone with the link can open it in DiffMergy to see the same comparison.

Related Tools