Diff Checker

Compare two texts line by line in your browser, with side-by-side or unified views and no upload.

  • Runs locally in your browser
  • No upload required

Capabilities

  • Keyboard shortcuts
  • Drag and drop
  • Local file intake
  • Download result
  • Advanced options

Try it

Rules affect matching only. They never change the text you pasted or the exported diff.

Paste two texts to compare them.

Δ##OriginalChanged

Supported formats

Input
text, file
Output
text
Files
Local file intake and drag/drop

Privacy

Runs entirely in your browser. Your input is never uploaded, stored, or sent to a third party.

Processing
In your browser
Privacy level
Browser only

The comparison found 1 added, 1 removed and 1 changed lines.

How it works

  • Split both sides into lines, keeping each line terminator verbatim.
  • Compute the line-level difference with the Myers algorithm and pair removed/added rows into changes.
  • Refine paired changes to word or character level when the chosen precision benefits from it.
  • Count the result: +1 −1 ~1, 2 unchanged.
  • Ignore options (whitespace, case, line endings, custom rules) affect matching only; they never alter the compared text.
  • The engine compares up to 20000 lines per side and an edit distance up to 4000.

Methodology

  1. Both sides are split with a single documented rule that keeps `\n`, `\r\n` and `\r` terminators verbatim, so reconstruction is exact.
  2. A line-level difference is computed with the Myers (1986) shortest-edit-script algorithm, bounded by a documented edit-distance limit so an extreme pair fails closed instead of freezing.
  3. Removed and added rows that pair into a change are refined to word or character segments; Smart precision chooses word when the pair shares a meaningful token, character otherwise.
  4. Comparison options are applied to a comparison key in a fixed order — whitespace mode, custom ignore rules, then case folding — and never modify the retained text.
  5. Unchanged context is grouped into hunks with a configurable window; the same model drives both the side-by-side and unified views and the exported unified diff.
  6. The Merge view groups each contiguous change run into one decision. Accepting a side records it in a small resolution map; the merged document is reconstructed from the retained lines, so it is exact, and the last accepted side wins when a change is re-accepted.
  7. All work happens in the browser through the pure engine, off the main thread above the worker threshold; no input leaves the page.

Usage

  1. Paste, type, drop or pick the original text, then the changed text.
  2. The comparison updates after a short debounce; press Find difference for an immediate run.
  3. Switch between Side-by-side and Unified, toggle Wrap lines and Hide unchanged lines.
  4. Use First / Previous / Next / Last change to move between changes; the keyboard shortcuts do the same.
  5. Choose Smart, Word or Character precision for intra-line highlighting; changing it never recomputes the base diff.
  6. Turn on an ignore rule (whitespace, case, line endings) or add a literal/regex rule; the compared text is never modified.
  7. Copy the summary or download the unified diff (.diff / .patch).
  8. Open the Merge view to accept each change from the original or the changed side, accept all changes from one side, and undo, redo or reset the decisions.
  9. From the merge view, copy or download the merged text, the unified diff from the original to the merged result, and either side — all generated in your browser.

Examples

These are examples, not current values: they use fixed inputs, while the interactive tool computes live results in your browser.

One changed line

jsonSelect to copy
{
  "original": "alpha\nbeta\ngamma\n",
  "changed": "alpha\nBETA\ngamma\n"
}

The paired change is refined to a word or character segment.

An added line

jsonSelect to copy
{
  "original": "a\nb\n",
  "changed": "a\nb\nc\n"
}

The changed side has a trailing newline that the original does not.

Limitations

Why a local diff checker

Diff tools are used on source files, configuration and logs that often contain credentials, customer data or unreleased work. Sending that text to a server — or gating the best features behind an account or a desktop app — turns a routine comparison into a disclosure decision.

This tool runs the same comparison in the page. Nothing is uploaded, no account is required, and the privacy claim is enforced by an automated network monitor rather than asserted in copy.

Reading a diff

A line diff pairs the two files: equal lines are context, removed lines exist only on the original side, added lines only on the changed side, and paired removed/added rows are changes. Counts report each of those, so a large rewrite is distinguishable from a single-character edit.

Intra-line highlighting marks exactly what moved inside a changed line, which keeps small edits in long lines readable.

Ignore rules are matching-only

Real files differ for uninteresting reasons: timestamps, build ids, session tokens, indentation or line endings. Ignore rules remove those patterns from the comparison key so the meaningful changes stand out.

The rules never rewrite the text. The editors and any exported file keep every byte you supplied, which is why you can safely re-run the comparison with different rules.

Local-only by construction

Processing uses the pure engine in this project, off the main thread above a size threshold. There is no remote service, no third-party script and no content in a URL, log or analytics event.

The workspace stores nothing: there is no opt-in persistence key for this tool, and clearing the workspace removes the text from the page.

Frequently asked questions

Is my text uploaded anywhere?
No. The comparison runs entirely in your browser using the local engine. There is no upload, no account, no share link and no server round trip; a network monitor in the test suite proves typing produces no outgoing request.
Does the tool change my text?
No. Ignore rules and precision affect matching and highlighting only. The original and changed editors keep the text exactly as you pasted it, and the exported files are derived from it.
What is the difference between Smart, Word and Character precision?
Precision controls how a changed line is highlighted inside the line. Smart picks word or character per change, Word highlights whole words and Character highlights individual characters. Switching precision never recomputes the underlying line diff.
What do the ignore rules do?
Ignore whitespace, ignore case and normalize line endings make the comparison treat those differences as equal. Custom literal or regular-expression rules remove a matching pattern (for example a timestamp) from the comparison key only; the compared text is untouched.
Can I download the result?
Yes. Copy summary copies a short count line, and Download unified diff saves a standard .diff/.patch file generated locally from the comparison model.
Can I merge the two sides and export the merged result?
Yes. The Merge view lists every change with Accept original and Accept changed, plus bulk accept, undo, redo and reset. From there you can copy or download the merged text, the unified diff from the original to the merged result (.diff/.patch) and either side. Everything is generated in your browser and nothing is uploaded or shared through a server.
What happens with very large files?
The comparison runs off the main thread above a size threshold and publishes tested limits. You can freeze automatic re-diff while editing and run it manually; past the documented limits the tool shows a clear message instead of freezing or truncating.
Are there ads in the comparison workspace?
No. Ads only ever appear in approved slots around the tool page, never between the editors, over the result, or next to the primary action.

Sources

  1. GNU diffutils manual — Free Software Foundation
  2. POSIX diff utility — The Open Group
  3. An O(ND) Difference Algorithm and Its Variations (Myers, 1986) — ACM