Text Diff
Text Diff is an offline two-pane text and file comparison tool. Beyond highlighting changes, it states in one sentence which line and which field the first difference starts at — so you don't have to hunt for the starting point in a screen full of red and green.

- Paste text into each pane, or drag files into A and B
- The dropdown above the result shows the detected format ("Detected as: CSV"); switch it if wrong
- The banner spells out where the first difference is — click "Jump" to go there
- Need to hand it to someone? "Export diff" gives you a
git apply-ready.patch
Two-pane input and folding
The input area is a pair of A / B editors with a swap button in the middle:
- Each pane header shows the filename ("Manual input" when typed) and line count; once a file is loaded it also offers an encoding dropdown, copy, and clear
- When both sides have content and a diff exists, the result area offers Hide inputs — collapse the editors into a one-line summary (A/B filenames, line counts, swap button) and give the screen to the diff
- Click Edit inputs anytime to go back; the summary bar can also swap A/B or clear both sides
First-difference locator
This is what sets the tool apart from a plain diff: the banner describes the first difference in natural language, phrased per format:
Pair it with the Previous / Next buttons to step through blocks; the header also shows "block i of n".
Format detection
The dropdown above the result reads "Detected as: …". Detection combines file extension and content, and can always be overridden:
- Plain text: line-by-line comparison
- CSV / TSV: guesses the delimiter first (whichever of
,\t;|yields the most consistent column count), then compares by column, handling quoted fields and""escapes - INI: compares key/value pairs and names the key whose value changed
- JSON: currently compared as text lines (a notice is shown)
Comparison options
- Diff only (on by default): fold away identical content, keeping just the diff blocks
- Context lines: how many lines to keep around each difference — "Changed lines only" or ±1 / ±3 / ±5 / ±10 lines (default ±1)
- Character-level (on by default): within a modified row, mark exactly which characters changed
- Ignore surrounding whitespace: skip differences caused by edge spacing
- Ignore case: skip letter-case differences
- Clear both sides: wipe both inputs in one click
Views and navigation
- Side by side / Inline: switch between the two-pane and unified views at any time
- Maximize / Exit maximize: full-screen mode for long files; press Esc to exit
- Swap A/B: exchange the two sides in one click
- Expand folds: identical runs collapse to "⋯ N identical lines hidden (click to expand)"
- Stats: similarity percentage, line counts for A and B, and
~changed / +added / −deletedcounters (hover for the full "N differences · X changed / Y added / Z deleted" detail) - Hide inputs: collapse the editors into a summary bar, as described above
Performance guard
When the two sides diverge heavily, a line-level diff can take a long time. A 3-second timeout stops the run and shows "comparison timed out" rather than hanging the page. Click "Compare anyway" to force a full run with no time limit for that comparison. Any content change re-arms the guard.
For longer inputs (roughly 10,000 characters combined), the comparison is handed to a Web Worker on a background thread, so typing and scrolling stay smooth; if the browser lacks Web Workers or the worker fails, it falls back to the main thread (deferred by a frame so click feedback paints first).
Encoding detection
Uploaded files are auto-detected as UTF-8, GBK, Big5, UTF-16LE, and other common encodings. The encoding dropdown in each pane header lets you re-decode manually when detection is off — especially useful for CSVs exported from different systems, GBK config files in legacy projects, and Windows logs.
Export
- Copy A / Copy B: copy either side out
- Export diff: generate a standard unified diff (
.patch) forgit applyor a code review tool. The filename defaults to B's filename
Common patterns
- Verify a config change: drop in two
.ini/.envfiles and read off which key's value moved - Compare tabular data: two exported CSVs, located down to the exact field
- Self-review before a PR: compare local changes against the deployed version and export a
.patch - Proofread a translation: enable "Ignore surrounding whitespace" to see only substantive edits between revisions
Everything runs locally in your browser — nothing is uploaded — safe for sensitive configs and private code.

