---
title: "Text diff"
canonical: "https://devtools.nicxon.tech/tools/text-diff/"
source: "https://devtools.nicxon.tech/tools/text-diff/"
generator: devtools.nicxon.tech
---

# Text diff

> Compare two blocks of text and see additions and deletions highlighted at the word level.

## What this does

This computes the difference between two blocks of text and renders it
 inline: removed spans struck through, added spans highlighted, everything
 else untouched. It uses [jsdiff](https://github.com/kpdecker/jsdiff),
 which implements the standard Myers diff algorithm, at three
 granularities — whole lines, whole words (keeping whitespace), or
 individual characters. Options let you fold away case-only and
 surrounding-whitespace-only differences.

It runs in your browser. Two drafts of a contract clause, two versions of a
 log, or a config diff with credentials in it can all be compared without
 anything being sent anywhere.

## When you'd use it

- Comparing two API responses to see exactly which field changed.
- Checking what an automated formatter or a find-and-replace actually altered.
- Reviewing an edit to a piece of copy, an email, or documentation.
- Spotting the one character that differs between a working and a broken config value.
- Diffing text you can't paste into a hosted tool for confidentiality reasons.

## Worked example

Left:

```
The quick brown fox jumps over the lazy dog.
```

Right:

```
The quick red fox leaps over the lazy dog!
```

In **Word** mode the diff reads: "The quick
 brownred fox jumpsleaps over
 the lazy dog.!" — three small changes, each shown
 exactly where it happens. Switch to **Line** mode and, because
 the single line changed at all, the whole line is marked removed and the
 whole new line added — more faithful to how a line-oriented tool sees it,
 less useful for reading. **Character** mode would additionally
 show that `jumps` → `leaps` keeps the `s`
 at the end.

## Limits and gotchas

- **Not a merge or patch tool.** No three-way merge, no conflict markers, no unified-diff export.
- **Large inputs.** Character-mode diffing of very large texts is O(n·d) and can be slow; drop to Word or Line mode.
- **Whitespace and line endings** are real differences unless you enable the ignore option. Mixed `
`/`
` is a frequent false positive.
- **Moved blocks** show as a deletion in one place and an insertion in another; the tool doesn't detect that a paragraph was relocated.
- **Unicode.** Combining characters and emoji sequences may split in Character mode in ways that look odd; Word mode is safer for those.

## How to use

- **Paste both versions** — Put the original on the left and the changed text on the right.
- **Choose granularity** — Word for prose, Line for code or config, Character for small precise edits.
- **Set the ignore options** — Optionally ignore case, or ignore leading and trailing whitespace, to hide changes you do not care about.
- **Read the inline diff** — Deletions are struck through in red, insertions are highlighted in green, unchanged text is left plain.

## Frequently asked questions

### Word, line, or character — which should I pick?

Line for source code, config files, and anything where a line is the unit of meaning. Word for paragraphs of prose, where line-level diffing would mark a whole rewrapped paragraph as changed. Character for spotting a single transposed letter or a changed digit in an otherwise identical string.

### Two visually identical texts show as different.

Almost always an invisible character: trailing spaces, a tab vs spaces, Windows \r\n vs Unix \n line endings, a non-breaking space pasted from a web page, or a Unicode look-alike. Try Line mode with "ignore leading/trailing whitespace", and if it still differs, use Character mode to find the exact spot.

### Is this a real merge tool?

No. It shows what changed between two texts; it does not do three-way merges, conflict resolution, or produce a patch file. It is for eyeballing differences — comparing two API responses, two versions of a message, a config before and after an edit.

### Does the diff match what git would show?

The set of changed regions is usually the same, but the presentation differs. Git shows whole changed lines with +/- prefixes; this tool shows changes inline, and in Word or Character mode it highlights sub-line edits that a default git diff would show as a full line replacement.

---
*Source: [https://devtools.nicxon.tech/tools/text-diff/](https://devtools.nicxon.tech/tools/text-diff/) — generated by devtools.nicxon.tech.*
