How to Compare Two Files Online and See Every Change
You have two versions of the same file: a contract before and after the other side’s edits, a configuration file that worked yesterday, or two exports of the same data. Reading them line by line is slow, and the one change that matters is easy to miss. A comparison tool (often called a diff tool) does the reading for you and shows exactly what changed.
This guide shows how to compare two files online with the free File Comparison tool, how to read the result, and a few tricks that make comparisons cleaner.
What a file comparison shows
A comparison lines up the two texts and marks every line as one of four things:
- Unchanged: the same on both sides.
- Added: only in the right (newer) version.
- Removed: only in the left (older) version.
- Modified: on both sides, but different. The changed characters inside the line are highlighted, so even a single changed digit stands out.
Lines that change together are grouped into change blocks. The summary above the result tells you how many blocks there are and how many lines were added, removed and modified.
How to compare two files, step by step
- Open File Comparison. The left editor (Left / Original) is for the older version, the right editor (Right / Target) for the newer one.
- Add your texts. Paste into each editor, or click Upload File on either side. Text and code files work: .txt, .md, .json, .csv, .xml, .html and most programming languages.
- Pick a language (optional). Choosing JSON, XML, Python, SQL and so on under Language adds syntax colouring. It only changes the colours, not the comparison.
- Choose the options. Tick Ignore whitespace, Ignore line endings or Ignore case if those differences don’t matter to you.
- Click Compare. The result appears under the editors.
Reading the result
There are two ways to look at it:
- Side by side shows the two versions next to each other, with the changed characters highlighted. It’s the easiest view for documents and short files.
- Unified shows one column, with removed lines marked − and added lines marked +, the way code reviews show changes.
To go through the changes one by one, use Previous and Next, or click a change in the list. In long files, tick Collapse unchanged lines to hide everything except the changes and a few lines around them.
Moving changes between the two versions
A comparison is often the first step of a merge: you want some of the changes, but not all of them. Every change has Move to Right and Move to Left buttons that copy that change to the other side. Pick the ones you want, and the editors update straight away.
Made a mistake? Undo change and Redo change step back and forward, and Swap sides exchanges the two texts. When you’re happy, use Copy or Download on either side. Moving changes, undoing and changing options are free for 30 minutes after you click Compare.
Tips for cleaner comparisons
- Ignore whitespace for code and copied text. Re-indented code, or text copied from a PDF or an email, often differs only in spaces. Ignoring them leaves just the real changes.
- Ignore line endings for files from different computers. Windows ends lines differently from macOS and Linux, which can make every line look changed.
- Format JSON and XML first. If one file is squeezed onto a single line, the whole file shows up as one giant change. Run both through the JSON Formatter or the XML Formatter first, then compare.
- Put the older version on the left. Then “added” really means new, and “removed” really means gone.
- Split very large files. Each side can hold up to 20,000 lines. For bigger files, compare them in parts.
When comparing files helps
- Code: see exactly what changed between two versions before you deploy or send them for review.
- Configuration files: find the one setting that broke something.
- Documents and contracts: paste the plain text of two versions to see every word that was edited. Word and PDF files need to be copied as text first.
- Data exports: compare two CSV exports to find new, deleted or changed rows.
- Translations: check which texts were updated since the last version.
Is it private?
To work out the differences, the two texts are sent to our server, compared in memory and sent back. They are not saved or logged. Even so, don’t paste passwords, keys or other secrets into any online tool, this one included.
Frequently asked questions
Is File Comparison free?
Yes. You get free comparisons every day, and you don’t need an account. Each click on Compare counts as one use.
Can I compare Word or PDF files?
Not directly: the tool compares text. Copy the text out of each document and paste it into the two editors. You’ll see every changed word, though not changes in formatting.
Does the language setting change the result?
No. It only adds syntax colouring to make code easier to read. The comparison itself is the same for every language.