Command Palette

Search for a command to run...

Diff

Diff Viewer

Compare two texts with unified or split view, full or incremental context.

Diff Viewer
Compare two texts with unified or split view, full or incremental context.
+0 additions-0 deletionsShowing Full diff
Unified diff
Single column with + / - markers.

What

Diff Viewer definition

A diff viewer highlights additions and deletions between two texts.

Cases

Use Cases

1

Review changes between versions

2

Generate a patch-style diff

3

Verify edits before publishing

How To

How to Compare Two Texts

A step-by-step guide to visualizing differences between original and changed text.

1

Paste texts

Paste the original on the left and the updated version on the right.

2

Select view mode

Choose unified or split view, and full or incremental context.

3

Review changes

See highlighted additions and deletions, then copy the diff.

Knowledge

Understanding Diff and Version Control

What is a Diff?
A diff (difference) shows changes between two versions of text. It identifies added, deleted, and modified lines. Diffs are fundamental to version control systems and code review processes.
Diff Algorithms
The most common algorithm is LCS (Longest Common Subsequence). It finds the longest sequence of lines that appear in both versions, then shows differences around those common lines. Myers' algorithm is a popular efficient implementation.
Unified vs Split View
Unified diff shows changes in a single column with + for additions and - for deletions. Split (side-by-side) view shows original and modified versions in parallel columns. Each format has advantages for different review styles.
Context in Diffs
Context lines are unchanged lines surrounding modifications. They help reviewers understand where changes occur. Standard diff shows 3 lines of context by default. More context aids understanding; less context focuses on changes.
Diff in Version Control
Git, SVN, and other version control systems use diff internally to store changes efficiently. Patch files are structured diffs that can be applied to recreate changes. Understanding diffs is essential for code review.

FAQ

Diff viewer FAQ

What is a unified vs split diff?
Unified shows one column with + and - lines; split shows original and changed columns side by side.
What does incremental diff mean here?
Incremental view keeps only changed lines with a small context window, hiding unchanged sections.
Can I copy the diff?
Yes. Use the Copy unified diff button to grab a patch-like view.
How are differences calculated?
A line-based LCS diff runs locally in your browser; nothing is sent to a server.
Does it keep formatting?
Whitespace and line breaks are preserved; color highlights are only visual.
When should I choose full vs incremental?
Full shows the entire file with context; incremental is best for quick reviews of only the changed areas.
Diff Viewer