Diff Checker — Compare Text Online

Paste an original and a changed version to see added, removed and modified lines side by side — with the exact words that changed highlighted inside each line.

Runs in your browser
 
The comparison appears here.

Your data never leaves your computer. All processing happens 100% locally in your browser.

How to use the Diff Checker

  1. Paste the original version into Original text and the new version into Changed text (or open two files).
  2. Differences are computed as you type; press Compare (or Ctrl+Enter) for very large inputs.
  3. Switch between Side by side and Inline views. Changed words are highlighted inside each modified line.
  4. Tick Ignore whitespace or Ignore case to hide differences that don’t matter, and expand collapsed regions by clicking them.
  5. Use Copy diff to get a unified diff you can paste into a code review or apply with git apply.

What is a diff checker?

A diff checker compares two versions of a text and shows exactly what changed: lines that were added, lines that were removed, and lines that were modified. Developers use it to review config changes, compare API responses or check what a formatter changed; writers and editors use it to compare drafts or contract revisions. It is the same idea as git diff or the diff command, presented visually in your browser.

How the comparison works

The tool first finds the longest common subsequence of lines between the two texts using the Myers diff algorithm (the algorithm behind Git’s default diff, via the open-source jsdiff library). Lines that appear in both, in the same order, are unchanged; everything else is an addition or a deletion. Where a deleted line and an added line sit at the same spot, they are paired as a modification and compared again word by word, so you see that only 8080 became 8443 instead of two unrelated red and green lines.

Identical lines at the start and end are skipped before diffing and line contents are hashed, which keeps comparisons of several thousand lines fast. Everything runs locally — nothing is uploaded.

Side-by-side vs. inline view

ViewBest for
Side by sideWide screens and reviewing edits within lines; the original stays on the left, the new version on the right.
Inline (unified)Phones and narrow windows, and long lines. Deleted lines (−) are listed above added lines (+), like a GitHub pull request.

Options

  • Ignore whitespace treats runs of spaces and tabs as a single space and ignores leading and trailing whitespace — perfect when one file was re-indented.
  • Ignore case treats “Error” and “error” as equal.
  • Collapse unchanged hides long unchanged stretches, keeping three lines of context around each change. Click a collapsed row to expand it.
  • Copy diff produces a standard unified diff (---/+++/@@ hunks) that tools such as patch and git apply understand.

Tips

Comparing minified code or JSON? Format both versions first — with the JSON Formatter, JavaScript Formatter or CSS Formatter — so the diff shows real changes instead of one giant line. To strip duplicate lines from a list before comparing, use Remove Duplicate Lines.

Tools that pair well with the Diff Checker

  • Regex Tester — Type a pattern and watch matches highlight live in your test text.
  • Word Counter — Paste or type your text to count words and characters live — plus reading and speaking time, keyword density and length checks for SEO titles, meta descriptions and social posts.
  • HTML Formatter — Paste minified or messy markup and get clean, consistently indented HTML — including embedded <style> and <script> blocks.
  • CSS Minifier — Paste a stylesheet to shrink it instantly.

Frequently asked questions

Is my text uploaded to a server?
No. The comparison runs entirely in your browser, so confidential documents, code and configuration never leave your device.
How large can the texts be?
Several thousand lines compare in well under a second. Inputs above roughly 400,000 characters wait for you to press Compare instead of updating live, and extremely different large texts fall back to showing the changed region as replaced.
What does “Ignore whitespace” ignore exactly?
Leading and trailing whitespace on each line, and differences in the amount of whitespace between words (a tab versus two spaces). Lines that differ only in that way are shown as unchanged.
Can I compare Word or PDF files?
This tool compares plain text. Copy the text out of the document (or save it as .txt) and paste it in; formatting such as bold or fonts is not compared.
What is a unified diff?
A standard text format for changes, with - for removed lines, + for added lines and @@ headers giving line numbers. It is what git diff prints and what patch tools apply.

Related tools