Text Guide

How to Compare Two Texts and Find Differences Online for Free (Word by Word or Line by Line)

Someone sends back a “final” version and swears they only fixed a typo. Reading both versions side by side to check that is slow, and the one changed number is exactly the one your eyes skip. The ToolTiny Text Compare tool puts the two versions in two boxes and marks every difference for you, either word by word or line by line. This guide follows a real recording of a short agreement, explains what each result number means and shows how to merge the two versions into one.

When Is a Text Comparison Useful?

The tool compares plain text. For Word files keep reading, because there is a separate tool for those, mentioned at the end.

Watch the Whole Process

The recording copies two versions of an agreement from Word, pastes them into the tool, compares them word by word, builds a merged text and exports the result.

How to Compare Two Texts, Step by Step

  1. Open Text Compare

    Open the Text menu in the top bar and choose Text Compare, or go straight to tooltiny.com/text-compare.html.

    Text menu with Text Compare highlighted
    Text → Text Compare
  2. Find the two boxes

    The page has Original Text on the left and Changed Text on the right. Each box has a Load File button. Under them you will find the Word by Word and Line by Line switch, three checkboxes and the blue Find Differences button.

    Text Compare page with two empty boxes
    Original on the left, changed on the right
  3. Get your two versions ready

    Open both versions in the program you already use. In our recording they are two copies of a short service agreement in Word: the first draft on top, the second draft below. Select the text of the first one and copy it.

    Two versions of an agreement in Word
    Copy the first version
  4. Paste the original

    Click the Original Text box and paste. The red wavy lines are only your browser's spell checker and have nothing to do with the comparison.

    Original text pasted into the left box
    Original pasted on the left
  5. Paste the changed version

    Copy the second version and paste it into the Changed Text box. Our two versions have 66 and 77 words. You can also use Load File above each box to read a text file instead of pasting.

    Both texts pasted into the two boxes
    Both versions in place
  6. Choose how to compare

    Word by Word is selected by default and suits contracts and normal writing. Line by Line suits code, configuration files and logs. The three checkboxes on the right, Ignore whitespace, Ignore case and Normalize JSON, are explained below. We kept the defaults.

    Word by Word and Line by Line switch with the options
    Word by Word, no options
  7. Click Find Differences

    Press the blue Find Differences button. The result appears right under the two boxes, so there is nothing to wait for or download.

    Cursor on the Find Differences button and the result below
    Find Differences
  8. Read the result

    Removed text is red with a strikethrough and added text is green. The bar above the text counts the changes: 92 chars added, 25 chars removed, 6 modified and 86.0% similar. In our example you can see 30 became 45, 2 became 1.5, 60 became 30, remains became becomes, Supplier became Client, until became once, and a whole new sentence was added.

    Comparison result with highlighted changes and the statistics bar
    Red is removed, green is added
  9. Build a merged text

    Under the result, Build Merged Result lists every change. Each change has Keep Original and Keep New. A sentence that was only added has Keep It and Discard. By default everything keeps the new version, so the merged text starts out equal to the Changed Text. Click the buttons for the changes you want to undo.

    Build Merged Result list with Keep Original and Keep New buttons
    One row per change
  10. Copy the merged result

    Click Copy Merged Result. The text you built is copied to the clipboard, ready to paste into your document or e-mail.

    Cursor on Copy Merged Result
    Copy Merged Result
  11. Export the comparison

    Click Export as HTML to download text-compare-result.html. It is a single file that keeps the red and green highlighting and the statistics, so you can attach it to an e-mail or a ticket.

    Cursor on the Export as HTML button
    Export as HTML

Word by Word or Line by Line?

The two modes use the same comparison engine but cut the text into different pieces before they compare it. That decides what you see highlighted:

Word by WordLine by Line
ComparesWords, one after the otherWhole lines
What gets highlightedOnly the words that changed inside a sentenceThe entire line that changed
Best forContracts, essays, e-mails, notesCode, configuration files, logs, lists
Spaces and line breaksDifferences in spacing are not reportedA line that differs in any way is reported (see the options below)
The statistics bar countsCharactersLines

A simple rule: if the text is written for people, use Word by Word; if each line stands on its own, use Line by Line. If the result in one mode is hard to read, switch the mode and click Find Differences again.

A Real Example: Two Drafts of an Agreement

The two versions in our recording differ only in a few places, but the eye easily misses them in a block of text. This is everything the tool found in Word by Word mode:

OriginalChangedWhy it matters
within 30 dayswithin 45 daysDelivery deadline changed
interest at 2% per monthinterest at 1.5% per monthLate-payment rate changed
with 60 days written noticewith 30 days written noticeTermination notice changed
source code remains the propertysource code becomes the propertyOwnership wording changed
property of the Supplierproperty of the ClientThe owner changed
until full paymentonce full paymentThe condition changed
(nothing)The Supplier shall provide 3 months of free support after delivery.A whole new obligation

Six of these seven changes are replacements, and that is the 6 modified in the statistics bar: a removed piece directly followed by an added piece counts as one modification. The new sentence is only an addition, so it is not counted there. The other numbers say 92 chars added, 25 chars removed and 86.0% similar. The last figure is the share of characters the two texts have in common, so a high number does not mean the change is small: a single changed number can be the most important change in the whole text.

What Do the Three Options Do?

OptionWhat it doesUse it when
Ignore whitespaceIn Line by Line mode, extra spaces and tabs do not make a line different. Word by Word does not report spacing differences anyway.One file is indented differently or has trailing spaces
Ignore caseUpper and lower case letters count as equal.You do not care about capitalisation
Normalize JSONParses both texts as JSON, sorts the keys, re-indents them and compares line by line.You compare two JSON documents whose key order or formatting differs

If one of the two texts is not valid JSON, the tool tells you so and compares the texts as ordinary text instead. The same happens when a JSON file contains a number with more than 15 digits, because turning such a number into a standard JSON value would round it and two different IDs could then look equal.

Good to Know

Follow ToolTiny for short tutorials

One-minute clips on converting, repairing and editing documents and text.

Tips for Better Comparisons

Compare your two texts now

Paste both versions and click Find Differences. Free, no sign-up.

Open Text Compare

Related ToolTiny Tools

Frequently Asked Questions

How do I compare two texts online for free?
Open the ToolTiny Text Compare tool, paste the first version into Original Text and the second into Changed Text, choose Word by Word or Line by Line and click Find Differences. Removed text is red and added text is green. It is free and needs no sign-up.
What is the difference between Word by Word and Line by Line?
Word by Word marks the exact words that changed inside a sentence, which suits contracts, essays and notes. Line by Line marks whole lines that changed, which suits code, configuration files and logs where each line is a unit.
Is my text uploaded to a server?
No. The comparison runs in your browser with the open-source jsdiff library, and the text you paste is not sent to our server. The page itself loads fonts and ads as other pages do. Still, for confidential documents follow your company's rules.
Can I compare files instead of pasting text?
Yes. Use the Load File button above each box. It reads plain-text files such as .txt, .log, .conf, .py, .js, .html, .json, .md and .csv. Word, Excel and PDF files are not plain text; copy their text into the boxes or use a dedicated tool such as Compare Word Documents.
What do Ignore whitespace, Ignore case and Normalize JSON do?
Ignore whitespace treats extra spaces and tabs as equal in Line by Line mode (Word by Word already ignores them). Ignore case treats upper and lower case letters as equal. Normalize JSON parses both sides, sorts the keys and re-indents them so key order and formatting do not count as changes.
What does Build Merged Result do?
It turns the comparison into a text you can edit by choosing, change by change, whether to keep the original or the new wording. Everything starts on the new version, so the merged text begins equal to the Changed Text. Click Copy Merged Result to copy it.
How many characters or lines can I compare?
There is no fixed limit, but the work happens on your device. A few thousand lines or several thousand words are quick. Two very large texts that are very different from each other can be slow, and extremely different files should be split into parts.
Can I compare JSON, code or configuration files?
Yes. Use Line by Line for code and configuration files. For JSON, tick Normalize JSON so key order and indentation are ignored. JSON that contains numbers longer than 15 digits is compared as plain text, because normalizing it would round those numbers.