Skip to main content
UploadFree

Text Compare

Paste or import two versions of a text to see which lines were added, removed or changed. Your text stays on your device.

Text stays in this tab only. It is not saved, so refreshing or closing the page clears it.

Result

Add text to Original and Modified, then press Compare. The differences appear here.

How to compare two texts

  1. Add two texts

    Type, paste or import a .txt file into Original and into Modified.

  2. Choose options

    Optionally ignore case or leading and trailing whitespace on each line.

  3. Compare

    Press Compare, then read the result side by side or in a single column. Copy it or download a report.

Adding text

There are two plain-text editors, Original and Modified. You can type in them, paste, or import a local UTF-8 .txt file, up to the size limit below.

  • Paste button. The Paste button reads the clipboard only when you press it. The browser may ask for permission. If it is blocked, click in the editor and press Ctrl+V (Cmd+V on a Mac) instead.
  • Clear, Swap, Example and Reset. Each editor has Clear. Swap exchanges the two texts. Load example fills both with made-up sample text. Reset clears everything.
  • Comparing. Press Compare, or press Ctrl+Enter (Cmd+Enter on a Mac) in an editor. Nothing is compared on every keystroke. After you edit a text or change an option, the result is marked out of date until you press Compare again.

How the comparison works

The texts are compared line by line. Within changed lines, the changed words are highlighted.

  • Pairing changed lines. Changed lines are paired in order within each changed block, so the first removed line is shown against the first added line, and so on.
  • When words are not highlighted. Word highlights are skipped, and the whole line is marked instead, for lines longer than 2,000 characters or when the paired lines share little text.
  • Blank lines. Blank lines are kept and compared like any other line. Text is never trimmed or reflowed.

Options

  • Ignore case. Lines that differ only in upper and lower case count as matching.
  • Ignore leading and trailing whitespace. Applies to each line separately. Spaces inside a line still count. With this option, a missing line break at the very end of a text is also not counted as a difference.
  • Your text is shown as written. Options only affect which lines match. The results always show your original text. A line that matches only because of an option is marked with ≈, which means it differs only in ignored case or whitespace.

Line endings

Windows (CRLF), macOS and Linux (LF) and old Mac (CR) line breaks are all treated as the same line break, so a file saved on another system does not show every line as changed. The result notes when the two texts use different line endings.

A missing line break at the end of one text is shown as a separate note in the results.

Reading the results

  • Views. Choose side by side or unified. Phones start in unified. Line numbers from both texts are shown.
  • Additions and removals. Added lines are shown with + and green. Removed lines are shown with − and red. The marker means the result does not rely on colour.
  • Long lines. Long lines wrap by default. Turn off the Wrap long lines switch to scroll horizontally instead.
  • Unchanged lines. Long runs of unchanged lines are collapsed to 3 lines around each change. A button shows them.
  • Summary. The summary gives the number of lines added and removed. When nothing differs under the selected options, it says the texts are identical.
  • Markup is shown as text. Text such as <script> or HTML tags is displayed as literal text. It is never run or rendered.

Copy and download

Copy report and Copy changes copy plain text. Download report saves a .txt comparison report with + and − markers, line numbers and the active settings.

It is a readable report, not a patch file for patch tools.

Limits

per text
2 MB
lines per text
50,000
time limit for matching
4 s
result rows shown on the page
3,000

The size and line limits apply to each text separately. Matching has a time limit of 4 seconds. For very different large texts that reach it, the shared start and end are kept and everything between is shown as one replaced block, with a notice. The page shows up to 3,000 result rows; the downloaded report always contains the full comparison.

What happens to your text

The comparison runs in your browser, in a background thread (a Web Worker). Your text is not uploaded and is not sent to any server or API. It is not saved in the browser and not put in the page address. Refreshing or closing the tab discards it. See Privacy.

Not included in this release

  • Word, PDF or rich-text documents
  • Scanned images (OCR)
  • Comparing web pages by URL
  • Folder comparison
  • Merging changes
  • Running code

Frequently asked questions

Is my text uploaded?

No. It is compared in your browser. The site only delivers the page and its code.

Why is the result marked out of date?

You edited a text or changed an option after the last comparison. Press Compare again to update it.

Why does every line show as changed in another tool?

Different line endings can cause that in some tools. Here, CRLF, LF and CR are treated as the same line break, and the result notes when the two texts use different ones.

What does the ≈ mark mean?

The line matches only because of an option. It differs only in ignored case or whitespace.

Can I compare Word or PDF files?

No. This release compares plain text only. Copy the text out of the document and paste it in.

Do I need an account?

No. The tool is free and needs no sign-in.