How to use the Diff Checker
- Paste the original version into Original text and the new version into Changed text (or open two files).
- Differences are computed as you type; press Compare (or Ctrl+Enter) for very large inputs.
- Switch between Side by side and Inline views. Changed words are highlighted inside each modified line.
- Tick Ignore whitespace or Ignore case to hide differences that don’t matter, and expand collapsed regions by clicking them.
- 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
| View | Best for |
|---|---|
| Side by side | Wide 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 aspatchandgit applyunderstand.
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?
How large can the texts be?
What does “Ignore whitespace” ignore exactly?
Can I compare Word or PDF files?
What is a unified diff?
- for removed lines, + for added lines and @@ headers giving line numbers. It is what git diff prints and what patch tools apply.