Skip to content
PithLab

↑↓ to move · Enter to open · Esc to close

Text Diff Checker: Compare Two Texts Line by Line

Spot the differences between two texts, line by line.

Use via API

Compare two texts line by line (Myers diff) and return added, removed and unchanged lines, plus a unified-style text diff. Send JSON, get JSON back.

POST https://pithlab.com/api/v1/tools/text-diff

curl https://pithlab.com/api/v1/tools/text-diff \
  -H "Authorization: Bearer $PITHLAB_KEY" \
  -H "Content-Type: application/json" \
  -d '{"original":"apples\nbananas\ncherries","changed":"apples\nblueberries\ncherries\ndates"}'

Fields and responseOpenAPI documentGet an API key

About the Text Diff Checker

Compare two versions of text or code and see exactly which lines were added, removed or unchanged, with counts. Can ignore case and whitespace. Runs in your browser.

How to use the Text Diff Checker

  1. Paste the original text on the left and the changed text on the right, or press Example.
  2. The comparison updates as you type: removed lines are shown in red with a minus sign, added lines in green with a plus sign.
  3. Tick Ignore case or Ignore whitespace to skip differences you don't care about.
  4. Copy or download the diff as plain text.

Examples

One line changed, one added

Input

apples
bananas
cherries
---
apples
blueberries
cherries
dates

Output

  apples
- bananas
+ blueberries
  cherries
+ dates

Frequently asked questions

How does the comparison work?

It uses the Myers diff algorithm, the same approach behind git diff, to find the smallest set of line insertions and deletions that turns the original into the changed text.

Why is a whole line marked as changed when I edited one word?

This tool compares whole lines, so any change within a line shows as that line removed and its new version added. Placing the two versions next to each other makes the edited word easy to spot.

Do different line endings count as differences?

No. Windows (CRLF), Unix (LF) and old Mac (CR) line endings are treated the same, and a missing final newline is ignored.

Is there a size limit?

Each side can be up to 500,000 characters. Very different texts with thousands of separate changes are refused rather than freezing your browser; compare smaller sections instead.