Diff Checker

Original Text

Chars: 0 | Lines: 0

Changed Text

Chars: 0 | Lines: 0

Diff result will appear here

Enter two texts and click "Find Differences" to compare

About the Diff Checker

The Diff Checker compares two text blobs side-by-side using the same line-diff algorithm Git and unified-diff tools rely on (jsdiff under the hood). Paste two snippets — JSON, code, configuration, log lines, prose — and read the additions, deletions, and changes inline. Word-level granularity highlights the specific changed tokens within a line. Everything runs in your browser; the texts you paste, including production configs and proprietary code, never leave the page.

Updated: May 8, 2026

How to use the diff checker

  • Paste the original text on the left, the modified text on the right. The diff renders live as you edit either side.
  • Switch between line-level (default) and word-level granularity. Word-level highlights the changed tokens inside a line, useful for prose review or near-identical config files.
  • Use the file-upload buttons to load the original and changed text from disk (up to 5 MB each), or paste directly into the editors.
  • Switch between side-by-side and unified views — side-by-side aligns matching lines across two columns with synchronized scrolling; unified renders the classic single-column `+/-` diff. Small screens auto-collapse to unified.
  • Stats appear once a comparison runs: line additions, deletions, and the total change count.

Common use cases

  • Code review prep — paste the before/after of a refactor to see exactly what changed before opening the PR.
  • Configuration drift detection — production config vs staging config, helm values before and after a template render, Terraform plans.
  • Log line comparison — two requests that should have produced the same output but did not. Word-level diff pinpoints the divergent field.
  • Documentation diff — proofreading two versions of a paragraph, README updates, blog post revisions.
  • JSON/YAML structural review — paste two API responses or two manifests; the line diff surfaces field-level changes without requiring `jq` or `yq`.

Privacy and security

jsdiff runs entirely in your browser. The two text inputs you paste — whether they are production secrets, customer PII, source code, or proprietary configuration — are never uploaded. URL state is not auto-synced; refreshing the page clears both inputs. For sensitive comparisons you can disconnect from the network entirely and the diff still works.

Tips and pitfalls

  • Line-ending mismatches (LF vs CRLF) cause every line to diff. The "Ignore whitespace" toggle includes line-ending normalization. If you see "every line changed" between two seemingly identical inputs, this is usually the cause.
  • Word-level diff has a complexity ceiling. Two completely different paragraphs produce too many word-level moves to be readable; use line-level for substantive rewrites.
  • Trailing newline differences are silent killers. A file with a trailing newline and one without diff at the last line. Some tools handle this implicitly, jsdiff does not.
  • Tabs vs spaces: the diff treats them as different characters. To compare reformatted code, normalize both sides through a formatter (Prettier, Black, gofmt) before diffing.
  • Unicode normalization: composed (NFC) vs decomposed (NFD) forms of the same character diff at the character level. macOS's filesystem decomposes by default; this trips up filename comparisons.

Frequently Asked Questions

What algorithm does the diff use?
jsdiff implements the Hunt-McIlroy LCS (longest common subsequence) algorithm — the same family used by GNU diff and Git. Output is line-aligned by default, with word-level alignment available as a toggle.
Can I use this for code review?
Yes for ad-hoc snippets. For full PR review, use the GitHub/GitLab/Bitbucket diff viewer that integrates with the commit graph. The tool here is best for comparing two snippets you have outside version control — pasted from a chat, dumped from a config, or read from a log.
How do I diff two large files?
The browser handles tens of thousands of lines comfortably. For files with millions of lines (large logs, generated SQL dumps), command-line `diff` or `git diff --no-index file1 file2` is the right tool — they stream rather than buffering the whole file.
Does the diff handle Unicode and emoji?
Yes. jsdiff treats input as JavaScript strings, so multibyte UTF-8 characters and emoji are diffed correctly at character / word / line granularity. Be aware of the NFC vs NFD pitfall — visually identical characters can have different code points.
Is whitespace significant in the diff?
By default, yes. Toggle "Ignore whitespace" to ignore spaces, tabs, and line endings. Toggle "Ignore case" for case-insensitive comparison. Both toggles are in the toolbar above the diff view.
Can I export the diff as patch?
Yes — the unified-diff format (`+++ a/file`, `--- b/file`, `@@ ... @@` hunks) is exportable via Copy. Paste into a `.patch` file or apply with `git apply` / `patch -p1`. Useful for reproducing a change across machines.
How is this different from a JSON-aware diff like jsondiffpatch?
This tool is a general line/word diff. JSON-aware diffs treat key reorderings as semantic equivalents and produce structural patches. For JSON-specific comparison use jsondiffpatch in code, or sort the JSON keys before pasting (the JSON Viewer can do this).
Are my pasted texts uploaded?
Never. The diff algorithm runs in JavaScript inside your browser tab. Both input panels stay client-side; you can verify by opening DevTools Network tab and observing zero outbound requests during diffing.