Compare Two Texts (Diff)

Compare two texts online: line-level alignment, unified diff output, adjustable context and optional case-insensitivity. Runs in your browser, nothing uploaded.

Files stay local .txt、.md、.json、.csv、.log、.xml、.yaml、.yml Max 10MB
Text A
Text B

Options

How many unchanged lines to keep around each change.

What this tool does

Text diff aligns two texts line by line and marks which lines were removed, added, or kept — useful for reviewing config changes, comparing code/logs/JSON, or checking whether a copy-paste went wrong.

The output is standard unified diff format (the +/- lines you know from git diff), ready to paste into a code review, ticket or document. Everything runs in your browser and nothing is uploaded.

How to use

  1. Paste both texts Left is "before" (A), right is "after" (B). Got the order backwards? Hit swap.
  2. Tune the options "Context lines" controls how many unchanged lines surround each change; enable "ignore case" when casing does not matter (e.g. config keys).
  3. Copy or download Copy the result as plain text or download it as .txt. Lines prefixed with +/- are the actual changes.

FAQ

Is this the same as git diff?

Same format (unified diff), but no repository needed and none of git's rename heuristics — ideal for ad-hoc comparison of two arbitrary texts.

Are blank-line differences ignored?

No. Blank lines are lines too — they show up as changes. "Ignore case" only affects letter casing, not whitespace.

How large can the texts be?

Up to 10MB and 3,000 lines per side. LCS memory grows with the square of line count — this cap keeps the page responsive.

Can I diff two files?

Paste each file's content into the two panes (.txt/.md/.json/.csv/.log are all text). Binary files are rejected with a clear error.

Can the result be applied as a patch?

The format is patch-compatible, but file names are placeholders (left.txt/right.txt); applying a real patch belongs in git.

Is my text uploaded?

No. Comparison runs in a browser Worker; the text never leaves your device.

Limits

Up to 10MB and 3,000 lines per side; trim larger texts to the relevant parts first.

Line-level only: no character/word diff, no side-by-side rendering.

Binary content (NUL bytes) is rejected; output is a unified diff text, not HTML.

Related tools