apprun.icuDeveloper tool

Developer tool · Compare text

Compare two texts and see every insertion and deletion

Paste the original on the left and the changed version on the right. Rows line up one to one, removed lines are marked on the left and added lines on the right, and a line that exists on both sides with different wording is paired so the exact words that changed are struck through and underlined. Switch to a unified patch, walk the changes one by one, then copy or download the result.

Free no accountPrivate runs in this tab3 levels line, word, characterReal patch copy or download

1 · Paste both versions

original and changed
0 lines · 0 characters
0 lines · 0 characters

The numbers beside each box are that box's own line numbers, and they are the numbers used in the unified diff. Nothing leaves this tab.

2 · How to compare

word level
Detail inside a changed row
Rows are always paired line by line. This chooses how the differences inside a changed pair are marked: nothing extra, the differing words, or the differing characters.
View
Side by side keeps the two texts in aligned rows. Unified is the patch format. Inline reads as one column with the changes flowing together.

3 · Outputs

copy or download

The unified diff is the real patch format: a --- and +++ header, then @@ hunks with three lines of context. It applies with patch or git apply when both sides are whole files.

Changed lines only gives you the new text of every added and changed line, which is handy when you want to review just the edits.

no changes to walk

Side by side

Line by line comparison: removed lines on the left, added lines on the right
Line Original Line Changed
removed line added line changed pair struck through deleted inside a row underlined inserted inside a row

How to use Text Diff

Everything below runs in this tab. Nothing is uploaded, and no account is needed.

Step by step

  1. Paste the first version into Original text and the second into Changed text. Both boxes carry line numbers that match the numbers in the diff, and Load an example fills them with a sample you can edit.
  2. Choose how much detail is marked inside a changed row in How to compare: lines only, words, or characters. Lines is the plainest reading, characters is the most precise.
  3. Switch on Ignore whitespace, Ignore case or Ignore blank lines when formatting noise is hiding the change you care about. The text you pasted is always shown as you typed it.
  4. Pick a view: Side by side for the aligned rows, Unified for the patch format, or Inline for a single reading column where deletions and insertions flow together.
  5. Use Previous change and Next change to walk the changes, then Copy unified diff, Download .patch or Copy changed lines only to take the result with you.

Details and limits

Lines are paired first, then refined

Rows are always paired line by line, because that is what keeps the two sides aligned and the line numbers honest. The granularity choice then decides how much detail is marked inside a changed pair: nothing extra for lines, the differing words for words, or the differing characters for characters. A word diff never moves a change from one row into another.

The size guard is deliberate

The comparison is a longest-common-subsequence dynamic program, which needs memory proportional to the number of lines on each side. Above 200,000 characters or 5,000 lines on either side the tool refuses with a message instead of freezing the tab, and a comparison that would need more than four million cells shows its middle as one removed block followed by one added block. Common prefixes and suffixes are stripped first, so two large but similar files still compare exactly.

The unified diff is a real patch

The @@ headers carry the start line and the line count of each hunk on both sides, with three lines of context around every change, so the output has the same shape as diff -u and git diff. Line numbers refer to the pasted text, not to the rows you see, and the two names in the --- and +++ headers are placeholders you can rename before you send the patch on.

Equal after normalising is not identical

With ignore whitespace or ignore case switched on, two lines can count as equal while their text still differs. Those rows keep a tinted background and the differences are still marked inside the row, so you can see exactly what was ignored. Every copy and download contains the text exactly as you pasted it, normalisation only ever affects what counts as a match.

Install for offline use · Word Counter · Text Case Converter

Frequently asked questions

How do I compare two texts side by side?

Paste the first version into Original text and the second into Changed text. The rows line up one to one: removed lines are marked on the left, added lines on the right, and lines that exist on both sides with different wording are paired so the old and new wording sit next to each other. Everything runs in this tab and nothing is uploaded.

What is the difference between a line diff and a word diff?

A line diff treats a whole line as one unit, so a line changed by one word counts as one removed line and one added line. A word diff pairs the two lines and marks only the words that differ, which is much easier to read when the edit is small. This tool always pairs the lines first, then marks the differences inside each pair.

Can I copy the result as a patch file?

Yes. Copy unified diff produces the standard patch format: a --- line naming the original, a +++ line naming the changed text, then @@ hunks with three lines of context. Download .patch saves the same text as a file, which you can rename to .diff. It applies with patch or git apply when both sides are complete files, and the @@ headers say where each hunk belongs.

What do ignore whitespace, ignore case and ignore blank lines do?

Ignore whitespace compares lines after collapsing runs of spaces and tabs, so re-indenting a block no longer shows up as a change. Ignore case compares lower-case text, so capitalisation differences are hidden. Ignore blank lines drops empty lines from both sides before comparing, which keeps the line numbers of the real content stable. Your original text is always displayed as typed.

How is the similarity percentage calculated?

It is twice the number of matched lines divided by the total number of lines on both sides, written as a percentage. Two identical texts score 100 percent, two texts with nothing in common score 0 percent, and a lightly edited text sits in between. It is a quick signal rather than a measurement of meaning, because it counts lines instead of words.

Is there a size limit?

Yes. One comparison is limited to 200,000 characters and 5,000 lines per side, and the line comparison itself is capped at four million cells so the tab cannot freeze. Larger input is refused with a message rather than hanging, and a very long single line is shown as one replacement instead of computing every character. Splitting the text and comparing the parts avoids both limits.