Diff checker

Compare two blocks of text and optionally merge them

Paste text directly, or drag and drop a text file into either box.

Drop a file here

or paste text

Drop a file here

or paste text

This tool runs entirely in your browser. Your text is never uploaded or sent to a server.

About this tool

When comparing two versions of code or text, a line-by-line diff shows exactly what changed — which lines were added, removed, or modified. This tool highlights differences between two inputs, making it easy to spot what changed between versions, review code changes before committing, or merge manual edits. It's faster than visual inspection and more reliable than trying to spot differences by eye.

Common uses

  • › Reviewing code changes before committing to version control
  • › Comparing two versions of a file to understand what changed
  • › Merging manual edits into auto-generated content
  • › Validating refactoring by checking that functionality remains the same
  • › Debugging configuration changes by spotting additions or removals

Example

Input
Text A: The quick brown fox
Text B: The quick red fox
Output
Line changed:
- The quick brown fox
+ The quick red fox

Technical notes

  • › Line mode compares whole lines as the unit of change — a single character difference marks the entire line as changed. Word mode compares at the word level for a more granular view.
  • › The diff algorithm identifies the shortest edit path between the two texts, which sometimes produces a different grouping of changes than a human might choose, especially with repeated or similar lines.
  • › Whitespace differences (trailing spaces, tabs vs. spaces) count as changes — if a line looks identical but is marked as different, check for invisible whitespace differences.

FAQ

Should I use Line mode or Word mode?

Line mode is better for code and structured content where you want to see which lines changed. Word mode is better for prose where you want to see exactly which words were added or removed within a sentence.

Why does a line show as changed when it looks the same?

This usually means there's a whitespace difference — trailing spaces, tabs instead of spaces, or different line endings — that isn't visible but is still a real difference.

Can I use this to merge two versions of a file?

Yes — after comparing, click Build merged result and choose which version (A, B, or both) to keep for each detected change, producing a combined result you can copy or download.

Related tools