Text Compare (Diff Checker)

Compare two texts and highlight added and removed lines, words or characters

Compare by
View
Paste two versions of a text above to see what was added and removed.

Runs entirely in your browser. Nothing you type or upload is sent to us or stored.

Results are for general guidance. Please check anything important before relying on it. Terms of use

How to Use

  1. Paste the old version into Original text and the new version into Changed text, or use Open file under each box. Try a sample compares two versions of a rent agreement.
  2. Choose Compare by: Lines for documents and code, Words for edited paragraphs, or Characters for small spelling changes.
  3. Pick a View. Side by side shows the two versions next to each other. Unified shows one list with removed (−) and added (+) lines.
  4. Switch on Ignore case or Ignore extra spaces to hide differences you don’t care about. In line mode, Show only changes hides long unchanged parts.
  5. Check the counts of additions and removals, then look through the highlighted differences: removed text is red and added text is green. In line mode, the buttons above the differences copy them as text or download a .diff file, with - for removed lines and + for added ones.

Compare two texts and see exactly what changed

A text diff checker puts two versions of a text side by side and highlights every addition and deletion. It's the quickest way to answer “what did they change?” in a revised rental agreement, an edited assignment or SOP, a policy document, a translated paragraph, a config file or two versions of code. You don't have to read both versions line by line. You see only the differences, in red (removed) and green (added). Both texts stay in your browser and are never uploaded.

Lines, words or characters?

Compare byBest forWhat you see
LinesDocuments, lists, code, CSV and config filesWhole lines added, removed or changed, with line numbers; changed words inside a line are highlighted
WordsEdited paragraphs, essays, letters, contractsEach added or removed word in the flowing text
CharactersShort texts, spellings, IDs, numbersEvery single changed character

How the comparison works

The tool uses the popular open-source diff (jsdiff) library. It implements Eugene Myers’ “O(ND) difference algorithm”, from the same family of algorithms behind tools such as git diff. It finds the smallest set of insertions and deletions that turns the original text into the changed one:

original: The fee is ₹500, payable by 10 October.
changed:   The fee is ₹750, payable by 15 October.
changes:   500 → 750 and 10 → 15 (everything else unchanged)

In line mode, a removed line directly followed by an added line is shown as a changed pair in the same row, and the words that differ inside it are highlighted more strongly. The counters show how many lines (or words, or characters) were added and removed.

Worked example

Original: three lines, “one”, “two” and “three”. Changed: four lines, “one”, “2”, “three” and “four”. In line mode the result is 2 lines added and 1 removed: line 2 changed from “two” to “2” (one removal and one addition), and line 4 “four” was added at the end. The unchanged lines “one” and “three” are shown without colour so you can see the context.

Ignore options

  • Ignore case treats “GST” and “gst” as the same.
  • Ignore extra spaces treats any run of spaces or tabs as a single space and ignores spaces at the start and end of each line. It helps when text was retyped, copied from a PDF or re-indented. In line mode the original text is still displayed. In word and character modes the spaces are shown tidied.
  • Show only changes (line mode) hides long unchanged stretches and keeps three lines of context around each change. It's handy for long documents.

Tips

  • Use Swap texts if you pasted the versions the wrong way round. Additions and removals swap too.
  • For text copied from PDFs or Word, line breaks may fall in different places. If line mode shows almost everything as changed, try word mode.
  • Very large texts with many differences can take a moment, and character mode is the slowest. If a comparison is too heavy, the tool tells you and suggests line mode.
  • The diff shows what changed, not whether the change is correct. For legal or financial documents, read the highlighted parts carefully in full.

Frequently Asked Questions

Paste the old version on the left (Original text) and the new version on the right (Changed text). The differences show up straight away: removed text in red and added text in green, with counts of additions and removals.

The layout. Side by side shows the original and changed versions in two columns, row by row. Unified shows a single list in which removed lines are marked with − and added lines with +, like the output of git diff. Unified is easier to read on a phone.

Yes. Switch on Ignore case to treat capital and small letters as the same, and Ignore extra spaces to ignore extra spaces, tabs and spaces at line ends.

Lines for documents, lists and code. Words for edited paragraphs, essays or contracts. Characters for short texts where a single letter or digit may have changed.

Yes. The comparison runs in your browser. Neither text is uploaded to a server or stored, so you can compare agreements, answer sheets or code privately.