Text Diff
Paste original and updated text to produce a unified diff or structured JSON change report.
Text Diff
Compare two blocks of text line by line and return either a classic unified diff or a structured JSON report. It is useful for reviewing snippets, config changes, prompts, small documents, and pasted logs without leaving the browser.
Inputs
- Original text — the left/old version.
- Updated text — the right/new version.
- Output format —
unifiedfor a familiar patch-style diff, orjsonfor counts and machine-readable line operations. - Ignore case — match lines case-insensitively while preserving original text in the output.
- Ignore whitespace — normalize whitespace for matching while preserving original text.
- Context lines — unchanged lines to include around each hunk in unified output.
Everything runs locally in WebAssembly.
FAQ
What does the "context lines" setting do?
It controls how many unchanged lines are shown around each change hunk in the
unified output — 3 by default, like git diff, and anywhere from 0 to 100. Set
it to 0 to see only the changed lines, or raise it when you need more
surrounding text to locate a change in a big file.
If I ignore case or whitespace, what appears in the diff?
The original text. Those options only affect matching: Hello and hello
compare equal with ignore-case on, so the line isn't reported as changed, but
whatever is shown always keeps its exact original casing and spacing.
When should I pick JSON output instead of unified?
Unified is the familiar patch-style view for human review (and can be applied
with patch-style tooling). JSON gives you added/removed/changed/unchanged
counts and a machine-readable list of line operations — the right choice when a
script or another tool consumes the result.
Is the diff computed word-by-word or line-by-line?
Line-by-line. Each line is treated as a unit, so a one-character edit marks the whole line as removed-and-added. For prose where you want word-level changes, split the text so each sentence or clause is on its own line first.
Developer & Automation Access
Run it from the terminal
Same engine as this page, headless — via the gizza CLI:
gizza tool text-diff "alpha
beta
gamma" 'right=alpha
BETA
gamma
delta'New to the CLI? Get gizza →
Open it by URL
Pre-fill and auto-run this tool with query parameters — the names match the API/CLI:
https://gizza.ai/tools/text-diff/?left=alpha%0Abeta%0Agamma&right=alpha%0ABETA%0Agamma%0Adelta&format=unified&ignore_case=true&ignore_whitespace=true&context=3Machine-readable descriptor: tool.json — title + parameters JSON Schema for agents.
