String Diff

Compare two texts and highlight additions and removals.

String Diff compares two texts and highlights additions and removals inline. Choose to compare by characters, words or lines, and see how many characters were added and removed. It is useful for comparing config versions, copy edits, API responses or any two blocks of text.

What is a text diff?

A diff finds the smallest set of changes that turns one text into another. The result is a sequence of unchanged parts, removed parts and added parts. The granularity matters: a character diff pinpoints single-letter edits, a word diff reads naturally for prose, and a line diff is how version control tools show changes in code. Most diff tools are based on finding the longest common subsequence of the two inputs, so the unchanged text is the part both versions share in order.

How to use String Diff

  1. Enter both texts Put the first version in Original and the second in Changed.
  2. Choose granularity Set Compare by to Characters, Words or Lines.
  3. Read the diff Green insertions and red deletions appear in the Diff box.
  4. Check the totals The heading shows the added and removed character counts.

Frequently asked questions

Which mode should I use?

Use Words for sentences, Lines for code or lists, and Characters when you need to find tiny differences like a missing letter or swapped case.

Is whitespace significant?

Yes, spaces and line breaks are compared as part of the text, so differences in whitespace may appear as changes.

What do the plus and minus numbers mean?

They show how many characters were added and how many were removed in total across the diff.

Can I diff files?

The tool takes pasted text in two boxes. Paste the file contents into each.

Is the diff side by side?

No. It shows a single inline view with additions and removals marked in place.