text.cihat.dev

Text compare

Paste two versions of a text and see exactly what changed: removed words struck through, new ones underlined.

Compare by

How to use it

  1. Paste the original into the first box and the new version into the second.
  2. Compare by words for prose, by lines for lists and code, or by characters for short strings.
  3. Read the highlighted result. Tick the ignore options to hide differences in case or spacing.

Reading the result

The result shows one merged text. Words or lines that exist only in the original are struck through; words or lines that exist only in the changed version are underlined and shaded. Everything else is the same in both. The line above gives the totals.

The comparison uses the open-source jsdiff library, which finds the smallest set of insertions and deletions that turns one text into the other (Myers’ algorithm).

Words, lines or characters

  • Words suits essays, contracts and articles: an edited sentence shows the changed words, not the whole line.
  • Lines suits lists, configuration files and code, where each line is a unit.
  • Characters suits short strings such as codes, names or IDs, where a single letter matters.

Private by design

Many diff sites send both texts to their server, and some keep a shareable link. Here the comparison runs in your browser and nothing is uploaded, which matters for contracts, drafts and anything under NDA.

To compare two lists regardless of their order, sort both first with sort lines, then compare by lines.

Questions people ask

How do I compare two Word documents?

Copy the text of each document and paste them here. Word also has Review > Compare, which keeps formatting; this page compares only the text.

Can I compare code?

Yes. Choose Lines. Ignore spacing hides indentation and trailing-space changes.

Why is a whole paragraph marked as changed?

In Lines mode, a line counts as changed if any character in it changed, and a paragraph without line breaks is one line. Switch to Words to see the exact edits.

Are my texts stored?

No. Both texts stay in your browser and disappear when you close the page.