The layout
- Pane headers
- The file name (or a title from the command line), the path, and badges for encoding, line endings and line count. A dot marks unsaved edits, a lock a read-only side.
- Two panes
- Left and right scroll together. Lines that exist on one side only get a filler row on the other, so matching lines stay level.
- Highlighting
- Changed lines are tinted and the words that differ inside them are highlighted. When two lines have almost nothing in common, only the line tint is shown.
- Copy gutter
- The strip between the panes shows each difference, with arrow buttons that copy it to the right or to the left.
- Overview strip
- The column on the far right maps every difference in the file. Click or drag in it to jump.
- Status bar
- "Difference 3 of 12", counts of changed blocks and of left-only and right-only lines, the ignore options in effect, and each side's encoding and line endings.
Navigating differences
The current difference has an outline. DiffScope selects the first one when the files open. The same commands are in the Navigate menu.
- F7 or Alt+↓ goes to the next difference. Shift+F7 or Alt+↑ goes to the previous one. The toolbar arrows do the same.
- Click any changed line to make its block the current difference.
- Alt+Home and Alt+End go to the first and the last difference.
- Ctrl+Home and Ctrl+End go to the top and the bottom of the files.
- Ctrl+G goes to a line:
123,L12orR40for one side,+10/-5relative,$for the end. Alt+Enter brings the current difference back into view.
When the files match, a message says so. If only the encoding or the line endings differ, the status bar says Text identical — encoding or line endings differ.
Ignore options
The Ignore controls in the toolbar re-run the comparison at once:
| Control | Effect | Command line |
|---|---|---|
| No whitespace | Whitespace counts (default). | --ignore-whitespace=none |
| All whitespace | Ignores every space and tab. | -w |
| Leading/trailing | Ignores whitespace at the start and end of lines. | --ignore-whitespace=leading-trailing |
| Whitespace changes | Treats runs of whitespace as equal. | -b |
| Ignore case (Aa button) | Upper and lower case compare equal. | -i |
| Ignore blank lines | Inserted or removed empty lines are not differences. | -B |
Ignored differences are still shown, just not counted or highlighted. DiffScope remembers these options for the next comparison; options passed on the command line apply to that comparison only. View › Compare Options also has Compare Line Endings, which counts a CRLF / LF change as a difference.
Comparison rules
View › Compare Options › Comparison Rules… decides what counts as a real change. A difference a rule explains is unimportant: it is shown dimmed and F7 skips it. Unimportant Differences: Dim / Hide / Show switches between dimming them, hiding them, and treating them as real differences.
- Presets for common noise: version-control keywords, ISO-8601 and log timestamps, GUIDs, “Generated on” lines, hex addresses, copyright years and assembly versions. Each preset shows sample lines it matches.
- Line filters mark whole lines as unimportant, text filters only the matching parts of a line. Both are regular expressions you write.
- Ignore comments in C-family languages, Python, shell, PowerShell, SQL, CSS, INI, YAML, VB, batch files and XML / HTML. Text inside strings is never taken for a comment.
- File types apply rules by file name, for example timestamps in log files.
From the command line: --ignore-comments, -I RE, --line-filter=RE, --text-filter=RE and --rules FILE. See the command-line reference.
Prettify JSON / XML re-indents both files before comparing, so a minified and a pretty-printed file show only their real value changes. The prettified view is read-only.
Moved blocks and alignment
- Detect Moved Blocks marks lines that were removed in one place and came back unchanged in another. Ctrl+Alt+J jumps between the two copies.
- Similar lines inside a changed block are paired on one row, with their changed words highlighted. A change that is whitespace only is marked
␣. - When the automatic alignment pairs the wrong lines, put the caret on a line on each side and press Alt+A (Align With). The two lines are pinned side by side; Clear Sync Points removes them.
- The diff algorithm setting offers patience and histogram besides the default, which often align moved or reordered code better.
Editing in place
Each side is a full code editor: click where you want to change something and type. The comparison updates as you type, and DiffScope colours the syntax of the language it detects (shown in the status bar, where you can pick another one).
- The usual editing keys work: selection with Shift, Ctrl+A, cut, copy and paste, Tab for indentation.
- Undo with Ctrl+Z and redo with Ctrl+Y (or Ctrl+Shift+Z). The history covers both sides and block copies.
- A side that is read-only, or shown prettified, cannot be edited; a lock in its header says so.
Find and replace
Ctrl+F opens the find bar, which searches both sides (or just one), and Ctrl+H with the replace field. F3 and Shift+F3 go to the next and previous match, Esc closes the bar. Matches can be case-sensitive, whole words or regular expressions, and Replace All is one undo step.
Display options
In View › Display:
- Word Wrap wraps long lines; both sides stay aligned.
- Collapse Unchanged Lines folds long runs of equal lines into one row you can expand.
- Inline View (One Pane) shows the changes in a single column, removed lines above added ones.
- Show Whitespace, Show +/− Change Markers and Character-Level Inline Highlights change what is drawn.
- Line Details shows the current line of both sides one above the other, with every changed character marked.
Alt+F2 opens the accessible diff viewer, which reads the changes one by one as text for screen readers.
Copying differences
To make one side match the other for a single difference:
- Press Alt+→ to copy the current difference to the right, or Alt+← to copy it to the left.
- Press Ctrl+Alt+→ or Ctrl+Alt+← to copy and move straight to the next difference.
- Or click the arrow buttons for that difference in the gutter between the panes.
The copied lines replace the block on the other side, line endings included. Each copy is one undo step.
Saving
Ctrl+S saves every side that has unsaved edits. DiffScope writes each file back in its original format:
- Encoding. UTF-8, UTF-8 with BOM, UTF-16 LE and BE (with or without BOM) are kept as they were. Files that are not valid UTF-8 are read with a fallback code page (Windows-1252 unless you set another) and written back byte for byte. Click a side's encoding badge to reopen it with another encoding or to save it with one.
- Line endings. Every line keeps its own ending (CRLF, LF or CR), so a file with mixed endings stays mixed. A missing newline at the end of the file stays missing. New lines you add get the file's main line ending. Click the line-ending badge (or Edit › Convert Line Endings) to convert a side.
F5 reloads both files from disk. If you have unsaved edits, DiffScope asks first. If you close the tab with unsaved edits, it offers Save, Don't Save or Cancel.
Swap sides in the toolbar exchanges left and right, including their edits and read-only state.
Read-only sides
A read-only side shows a lock in its header. You cannot edit it, nothing can be copied into it, and its copy buttons are hidden. Set it from the command line:
| Switch | Makes read-only |
|---|---|
/leftreadonly, --left-readonly | The left side |
/rightreadonly, --right-readonly | The right side |
/readonly, /ro, --readonly, -r | Both sides |
Make a side read-only when it is a temporary copy of an older version that should not be edited.
diffscope old/config.json new/config.json /leftreadonly /title1:"Release 1.4" /title2:"Working copy"
Large files
Only the rows on screen are drawn, so files with hundreds of thousands of lines scroll smoothly. Very long lines are cut off on screen after 8,000 characters, with a note saying how many characters are hidden. The file itself is not changed.
