Diff Checker

Compare two texts line by line, word by word or character by character. Inline or side-by-side view, ignore case or whitespace, unified diff patch export.

Runs entirely in your browser. Your data is never uploaded.

Related Tools

View All

What is Diff Checker?

Compares an original and a changed text and highlights what was added and removed. You can compare by lines, words or characters, view the result inline or side by side, ignore case and whitespace differences, and export a unified diff (patch).

How to use Diff Checker

  1. Paste the original text on the left and the changed text on the right.
  2. Choose Compare by lines, words or characters, and the View (side by side is available for line mode).
  3. Tick Ignore case or Ignore whitespace changes if those differences do not matter.
  4. Read the summary of added and removed units, and open Unified diff (patch) to copy or download a patch.

Example

Input
Original: a / b / c  →  Changed: a / B / c / d (one item per line)
Output
2 line(s) added · 1 line(s) removed
- b
+ B
+ d

When to use Diff Checker

Use it to review edits to contracts, articles, configuration files or code snippets, or to check what changed between two versions of a list. For whole repositories or binary files, use Git or a desktop diff tool. Both texts stay in your browser.

How Diff Checker works

The comparison uses the diff library (jsdiff), which implements Myers' O(ND) difference algorithm to find the shortest edit script between the two token sequences. Line mode tokenises by lines (optionally ignoring case and leading/trailing whitespace), word mode by words and whitespace, character mode by characters. Removed parts are shown in red with strikethrough, added parts in green. The side-by-side view pairs blocks of removed and added lines into rows. The patch is produced with createTwoFilesPatch in unified format with 3 lines of context.

Common Use Cases

  • Reviewing changes between two versions of a document
  • Comparing configuration files or environment variables
  • Checking what a colleague changed in pasted text
  • Creating a patch file from two code snippets
  • Finding small differences in long lists

FAQs

Which algorithm is used?

Myers' diff algorithm via the jsdiff library – the same family of algorithm used by Git and GNU diff.

Why is a changed line shown as removed and added?

Line mode treats lines as units, so any change makes it a different line. Switch to word or character mode to see exactly what changed inside it.

Is my text uploaded?

No. Both texts are compared in your browser.

Can I apply the patch with Git?

The unified diff uses the file names original.txt and changed.txt; you can apply it with patch or git apply after adjusting the file names.

Explore more categories