How to Compare Two Text Files Online and Read the Diff

Updated

To compare two text files online, paste or upload the original text in the left pane and the modified text in the right pane on textcompare.org, then click Compare. The tool shows both versions side by side and highlights deleted strings in red and added strings in green, so you can see exactly what changed without installing software. This works for plain text and code in any modern browser on Windows, Mac, or Linux.

Before You Start

  • Two versions of the text: the original and the modified copy. You can paste them directly or use Choose Original File and Choose Modified File.
  • A modern browser such as Firefox, Chrome, or Edge. No installation is required.
  • A decision on privacy: processing happens in your browser, and nothing is saved on the server unless you choose to save it for sharing.

Step-by-Step: Compare and Read the Diff

1. Load both versions

Copy the original text into the left block and the modified text into the right block. If you prefer files, use the file chooser buttons above each pane. A Sample option is available if you want to see how the tool behaves before using your own text.

2. Run the comparison

Click Compare. The view switches to a side-by-side comparison with differences highlighted in color.

3. Read the highlights

  • Red marks strings that were deleted from the original.
  • Green marks strings that were added in the modified version.
  • The tool also calculates the number of lines added and deleted, which gives you a quick sense of the change size before you read line by line.

4. Move through each difference

Use the arrows in the bottom right corner of the diff view to jump from one difference to the next instead of scrolling. If you are looking for a specific string, use Search to find all occurrences.

5. Reduce noise with ignore options

Formatting-only changes can bury the real edits. Use options such as trim whitespace, render side by side, and word wrap to make the comparison easier to read. Trimming whitespace is especially useful when one version was reformatted or pasted from a different editor.

6. Format minified code first

If you are comparing code copied from a website, it may be minified into one long line. Right-click the pane you want to clean up and select Format Document, or click Format. Then compare again so the diff reflects logic changes rather than line-wrapping artifacts.

7. Export or share the result

  • PDF Export: download the diff view as a PDF for private sharing.
  • Public Share: save the diff online and share the URL. Saved data is sent over a 128-bit SSL/TLS connection, according to the site.

Quick Reference

Task Where to find it
Paste original / modified text Left and right panes
Upload files Choose Original File / Choose Modified File
Run comparison Compare button
Jump between changes Arrows, bottom right of diff view
Find a string Search
Clean up minified code Right-click pane → Format Document, or Format button
Reduce whitespace noise Trim whitespace option
Save for private sharing PDF Export
Share via link Public Share

Common Snags

  • The diff is full of whitespace changes. Turn on trim whitespace before comparing.
  • Everything looks like one changed line. The code is probably minified; format both panes first.
  • You cannot find a specific edit. Use the navigation arrows rather than scrolling, and search for a known string near the change.
  • You need to send the result to someone. Use PDF Export for a private copy, or Public Share if a link is acceptable. Note that saving online is a choice; browser-only processing means nothing is stored unless you save.

The tool places no limit on the number of comparisons, so you can repeat the process for as many file pairs as you need.