Text ToolsA little help for every day

Search by name or task, such as JSON or percentage.

Text Tools

Text Diff Checker: Compare Two Texts

Compare two versions of a text by line, word or character. Changes are highlighted, with a similarity score and a unified diff you can copy.

View all tools
ResultUpdates as you type
Lines added3
Lines removed2
Unchanged lines3
Similarity54.5%
11Project: Online toolbox
2−Version: 1.0
2+Version: 1.1
33Author: Alice
4+Maintainer: Bob
45Licence: MIT
5−Summary: everyday text tools
6+Summary: free everyday text tools

How to use Text Diff Checker: Compare Two Texts

Paste the earlier version into Original text and the new one into Changed text; the comparison updates as you type. Choose lines, words or characters, show everything or only the changes, and use Swap to reverse the direction.

  1. Paste both versionsPut the earlier version in Original text and the later one in Changed text.
  2. Choose how to compareCompare by lines for documents and code, or by words or characters for small edits; ignore case or whitespace if needed.
  3. Review or copy the diffRead the highlighted view, show only changes with context, or switch to Unified diff text and copy it.

How the comparison works, with an example

The tool uses the Myers diff algorithm, the default in git diff, to find the smallest set of insertions and deletions, so inserting one line does not make everything after it look different. Comparing a five-line project note with a six-line edit (Version 1.0 changed to 1.1, a Maintainer line added and the word "free" inserted) gives 3 lines added, 2 removed, 3 unchanged and 54.5% similarity. Similarity is twice the unchanged lines divided by the total number of lines in both texts. When a changed line is still similar to the old one, the exact words that differ are highlighted inside it.

Lines, words or characters, and three views

Line mode suits contracts, configuration files and code: each row shows the old and new line numbers with − or + markers. Word mode treats each Chinese character as a word and is good for proofreading paragraphs; character mode catches single-letter typos and changed digits. Everything shows the full text, Changes with context folds unchanged stretches and keeps two lines either side, and Unified diff text produces a copyable patch with @@ headers and three lines of context. In word or character mode the copyable version marks deletions as [-…-] and additions as {+…+}.

Accuracy and data handling

Before copying the output, check names, punctuation and the intended meaning against the source text. The calculation runs in your current browser; the tool code does not send the input to a processing API.

Often Used Together

Next step

FAQ

How does the tool decide two lines are different?

Lines are compared exactly, including case and spacing. Tick Ignore case or Ignore whitespace differences to treat "Hello World" and "hello world" as the same line.

Will one inserted line make the rest of the document show as changed?

No. The diff aligns matching lines on both sides, so an inserted or deleted line shows as a single change and everything after it still lines up.

How much text can I compare?

Up to 2 million characters in total. Word and character comparison has a much lower limit, so compare long documents by lines. If changes are too extensive to align, the middle is shown as one replacement.

Is my text uploaded when I compare documents?

No. The comparison runs in your browser, so you can check contracts or drafts without sending them to a server.

More Text Tools

Related tools