Overview / Text & Content / Text Diff & Comparison
Text & Content 100% In-Browser & Offline

Text Diff & Comparison

Compare two texts or code versions line by line, side by side or unified, with word highlighting, folded unchanged lines and a copyable patch.

Paste or type text; the result updates live.

Your files and input never leave your browser – nothing is uploaded.

Diff Viewer
Edit source texts (Original & Modified) Click to show/hide
Original (Before / Base)
Modified (After / Head)
Navigation: 0 / 0

A colleague sends the contract back with "small edits" and does not say where they are. Paste both versions into the text diff checker. It marks every added, removed and changed line, and inside a changed line it highlights the words that differ.

Compare texts in five steps

  1. Paste the original into Original and the changed text into Modified. A JavaScript example loads at the start. The Template menu loads a JSON or Markdown sample instead.
  2. Read the viewer below the boxes. Side-by-Side shows two columns. Unified shows one column with "-" and "+" before the lines.
  3. Press Next and Previous, or Alt+Down and Alt+Up, to jump from change to change. The badge shows your position, for example 3 / 7.
  4. Turn on Ignore whitespace when only the indentation moved. Keep Collapse unchanged on to fold long identical blocks down to 3 lines of context.
  5. Swap reverses the direction. Copy patch puts the result on the clipboard.

Config files, drafts and source texts

Code review without a pull request is the obvious job. Two copies of an .env file or an nginx config also fit, one from staging and one from production. A writer can paste draft 4 and draft 5 of a report and see which sentences the editor rewrote. A translator can compare two releases of a source text and work only on the new parts.

Why a reflowed paragraph looks like a total rewrite

The comparison works line by line. Break a paragraph at other places and every line counts as changed, even when no word moved. Windows files add a second trap. They often end lines with CRLF, so each line differs from its LF twin. Ignore whitespace fixes the CRLF case because it trims the start and end of every line. It leaves spaces inside a line alone, and it cannot repair a reflowed paragraph.

Word highlights have a limit too. A word is a run of letters A to Z, digits, _ and $. A letter such as "ü" or "é" is not in that set. It becomes its own piece, and the highlight looks broken up.

How big a file the tab can take

The line comparison builds a table of lines A times lines B. Two files with 10,000 lines each need about 400 MB, and the tab slows down long before that. The diff also runs again on every keystroke in either box.

The patch header and what it skips

The copied patch starts with --- a/original and +++ b/modified. It lists all lines and has no @@ headers. It always compares the exact text, so the whitespace option does not change it.

What happens to the two texts

Your text stays in the page. Typing, pasting and comparing send no request, and the Network tab of the browser developer tools shows this. Nothing is saved or downloaded. A copy button writes to the clipboard only when you press it.

Frequently asked questions (FAQ)

Open each file in an editor, copy the content and paste it into the Original and Modified boxes. The tool reads pasted text only and does not accept file uploads.