How to compare two texts
Diffline shows you every difference between two versions of a text in a few seconds. Here is how to use it:
- Add the original. Paste the older version into the box labelled Original. To compare two text files, click Open file or drag a file from your computer onto the box.
- Add the new version. Paste the updated text into the box labelled Changed, or open a second file the same way.
- Read the result. Differences appear below as you type. Lines in red were removed, lines in green were added, and lines that were edited show the exact words that changed in a darker shade. The summary counts how many lines were removed, added and changed, and how much of the text stayed the same.
- Adjust the view. Turn on Ignore case or Ignore spacing when those differences do not matter to you. Use Changes only to hide long stretches of identical lines, and switch between Side by side and Inline to suit your screen.
Tip: if you are comparing two lists where the order does not matter, open "Clean up both texts before comparing" and use Sort lines first. Only the real differences will remain. Press Ctrl+Enter at any time to refresh the comparison.
What you can compare
Anything that can be written as plain text can be compared. These are the jobs people use Diffline for most often:
Code
Check what changed between two versions of a function, a script or a whole file before you commit, deploy or review it. Diffline keeps indentation and line numbers intact, so it is easy to match a change to the right place in your editor. It is handy when you do not have Git at hand, or when a colleague sends you a snippet in chat.
Contracts and agreements
When a contract comes back "with a few small edits", paste both versions here to see every edit, not just the ones you were told about. A single changed number, date or "not" can matter a lot, and word level highlighting makes those easy to spot.
Essays, articles and translations
Writers and students can compare drafts to see how a piece has evolved, check what an editor changed, or confirm that a final copy matches the approved version. Teachers can compare a submission with an earlier draft.
Config files and JSON
Settings files such as JSON, YAML, XML, INI and .env often differ by one line that breaks everything. Compare a working config with a broken one to find the line that matters. You can also compare JSON online here: paste two API responses or two JSON files to spot the changed values. Use Ignore spacing if one file was reformatted.
Lists and data
Compare two email lists, product SKUs, column exports or log files to find entries that were added or dropped. Sorting both lists first gives the cleanest result.
Why Diffline is private
Many online diff tools send your text to their servers to process it. Diffline does not. The whole comparison is done by JavaScript inside the page you have open, on your own device. Your text is never uploaded, never stored on a server, and never seen by us or anyone else.
This matters when you are comparing contracts, unreleased code, private messages or anything else you would not want to post publicly. You do not have to take our word for it either. Open your browser's developer tools, switch to the Network tab and compare some text: you will see that no request carries your text anywhere. Once the page has loaded, you can even disconnect from the internet and it keeps working.
The only thing Diffline remembers is your choice of settings, such as Inline view or Ignore case, which is saved in your own browser. Your text is kept only in the open tab, so a refresh does not lose it, and it is gone as soon as you close the tab. You can read the full details in our Privacy Policy.
Frequently asked questions
How do I compare two texts online for free?
Paste the original text into the left box and the new version into the right box. Diffline highlights the differences right away. There is no sign up, no limit on how often you use it, and no cost.
Is it safe to paste confidential text into Diffline?
Yes. The comparison runs entirely in your browser using JavaScript. Your text is never sent to a server, saved in a database, or seen by anyone else. Closing the tab removes it.
Can I compare two text files?
Yes. Click Open file above each box, or drag a file onto it, and Diffline compares the two files line by line. It works with .txt, .csv, .json, .xml, .md, .log and most code files up to 50 MB each. The files are read by your browser and never uploaded.
Can I compare two Word documents or PDFs?
Diffline compares plain text. Open the Word document or PDF, select all, copy, and paste the text into each box. Plain text files such as .txt, .md, .csv, .json, .xml, .html and most code files can be opened directly with the Open file button or dragged onto a box.
How do I ignore differences in spacing or capital letters?
Tick Ignore spacing to treat runs of spaces, tabs and leading or trailing spaces as equal. Tick Ignore case to treat upper and lower case letters as the same. The result updates instantly.
What is the difference between side by side and inline view?
Side by side shows the original on the left and the changed text on the right, with matching lines lined up. Inline shows one column where removed lines appear just above the lines that replaced them, which works better on narrow screens.
Is there a limit on how much text I can compare?
There is no fixed limit on text, and files up to 50 MB can be opened. Big texts are compared in the background, so the page stays responsive: 50,000 lines usually take about a second. Very large results are shown a few hundred lines at a time as you scroll.
How does Diffline find the differences?
Diffline uses the Myers diff algorithm, the same approach used by Git. It finds the smallest set of lines to add and remove to turn one text into the other, then runs a second pass on changed lines to highlight the exact words that differ.
Does Diffline work on my phone or offline?
Yes. The page works in any modern mobile browser. Once it has loaded, the comparison needs no internet connection, so you can keep using it even if your connection drops.