Text Diff (compare two texts and see what changed)

Compare two texts line by line or word by word (per character for Chinese and Japanese) with additions, deletions and changes highlighted. View side by side or unified, and copy or save a unified diff.

  • Runs in your browser (no upload)

Up to 200,000 characters

Up to 200,000 characters

Compare by
View

Comparison

Lines added
0
Lines removed
0
Lines changed
3
LineOriginalLineChanged
1Packing list1Packing list
2Passport2Passport
3Before: Plane ticket (e-ticket)3After: Plane ticket (paper ticket)
4Charger4Charger
5Before: Folding umbrella5After: Sunscreen
6Before: Meet at the lobby at 9:00.6After: Meet at the lobby at 8:30.

Each text can be up to 200,000 characters. When there are very many differences, the amount of work is capped so the page never freezes.

How to use

  1. Paste the original text on the left and the changed text on the right.
  2. Choose line or word comparison, side-by-side or unified view, and optionally ignore whitespace or letter case.
  3. Review the added (green), removed (red) and changed lines, then copy or save the unified diff.

FAQ

What is a "changed" line?

Where removed lines are followed by added lines, they are paired in order as changes and shown next to each other, with the differing words (characters for Chinese and Japanese) highlighted.

How are the texts compared?

With Myers' diff algorithm (which finds the shortest edit script), computed in your browser. When there are very many differences, the amount of work is capped so the page never freezes; part of the result is then shown as a block deletion and insertion, and a notice says so.

What is a unified diff?

The diff format used by diff -u and Git. It includes 3 lines of context around each change and can be used with tools such as patch.

Notes & limitations

  • What you enter is processed only on this page and is not sent to YUCTS servers.
  • Each text can be up to 200,000 characters, and up to 2,000 rows are shown on screen (the unified diff always contains everything).
  • With very many differences, part of the result may be shown as larger blocks instead of the smallest diff.
  • Changed lines are paired in order; similar lines are not searched for and matched.