How to Use DiffMergy
A complete visual guide to mastering every feature of the platform
1. Code Compare
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.
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.
Select Language & Compare
Choose your programming language from the dropdown (30+ supported), set your indent preference, and click Compare or press Ctrl+Enter.
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
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
Open the Palette
Press Ctrl+K (or Cmd+K on Mac) on any page. A search box appears over the current screen.
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
Switch to 3-Way Mode
In the Merged Result panel, click the 3-way button. A new Common ancestor (base) editor appears.
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.
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.