FormatterHQ

Diff Checker – Compare Text Online

Paste two versions of a text and see exactly what changed. Added, removed and modified lines are highlighted side by side, with the changed characters marked inside each line.

Loading tool…
Ready.

How to use the Diff Checker - Compare Text

  1. Paste the original text on the left and the changed version on the right, or load a file into either side with Open file.
  2. Choose a view: Side by side, or Unified, which shows removed lines in red above the changed text.
  3. Optionally tick Ignore whitespace or Ignore case, and tick Collapse unchanged to fold long unchanged stretches around each change.
  4. Review the highlighted differences, step through them with Prev and Next, and use Copy above either side to copy that text.

Diff checker: find every difference between two texts

Spotting changes between two versions of a document by eye is slow and unreliable, especially when only a comma or a number changed. This diff checker compares the two texts with the Myers difference algorithm, the same approach as git diff, and highlights the lines that were added, removed or modified. Inside changed lines, the exact characters that differ are marked too.

Example

Original                         Changed
Shipping: 3-5 business days      Shipping: 2-4 business days
Returns: 14 days                 Returns: 30 days
Support: email only              Support: email and live chat
                                 Warranty: 2 years

The result shows three changed lines, with "3-5" → "2-4", "14" → "30" and "only" → "and live chat" highlighted, plus one added line. Because the lines are next to each other they form a single changed block, and the summary in the toolbar reads 1 change +4 −3: one block, four lines on the changed side and three on the original side.

Views

  • Side by side – the original and changed text in two aligned columns with line numbers. Best for reading and reviewing.
  • Unified – one column in which every removed line is shown in red directly above the text that replaced it. You can keep editing the changed text in this view. On screens narrower than 640 pixels the page starts in it.

Both views mark the changed characters inside a line, so a single edited word stands out even in contracts, articles and other writing where lines are long.

Options explained

  • Collapse unchanged – folds long unchanged stretches and keeps three lines around each change; click a folded bar to open it again. Useful for long files with few changes.
  • Ignore whitespace – ignores spaces and tabs at the start and end of a line and treats runs of them inside a line as a single space, so re-indented code and invisible trailing spaces, a common source of "phantom" differences, do not show up as changed.
  • Ignore case – Hello and hello count as the same.

Prev and Next (or Alt+↑ and Alt+↓) jump from one change to the next, Swap exchanges the two sides, and Copy above each side copies that text.

Windows (CRLF) and Unix (LF) line endings are normalized automatically, so a file edited on a different operating system does not appear completely changed.

When you need a unified diff file

The comparison on this page is visual: it does not write a patch file. If you need one, save the two versions as files and run diff -u original.txt changed.txt > changes.patch in a terminal. For the example above it prints a standard unified diff (the timestamps after the file names are left out here):

--- original.txt
+++ changed.txt
@@ -1,3 +1,4 @@
-Shipping: 3-5 business days
-Returns: 14 days
-Support: email only
+Shipping: 2-4 business days
+Returns: 30 days
+Support: email and live chat
+Warranty: 2 years

You can attach that .patch file to a ticket or apply it with git apply or patch.

What people compare

  • Two drafts of an essay, contract or policy to see what an editor changed.
  • Configuration files from two servers when one behaves differently.
  • Code snippets before and after a fix, when a full Git setup is not at hand.
  • Log output from a working and a failing run.
  • Translations or product descriptions exported at different times.

Comparing structured data

Line-based comparison treats JSON and XML as plain text, so a reordered key or re-indented file looks like a big change. For those formats, use the JSON diff or XML diff, which compare the structure instead. To compare files straight from your disk, the file diff tool is set up for that.

Privacy

Both texts are compared inside your browser. Nothing is uploaded, so you can safely compare contracts, source code or internal documents.

Frequently asked questions

How does the diff checker decide what changed?
It looks for the smallest set of edits that turns the first text into the second, using the Myers algorithm that Git also uses by default. Lines touched by an edit are grouped into changed blocks, and the characters that differ inside them are highlighted.
Can I ignore differences in spaces or indentation?
Yes. Tick Ignore whitespace: spaces and tabs at the start and end of each line are ignored, and runs of them inside a line count as a single space.
Why does every line show as changed?
The texts may use different line endings or indentation. Line endings are normalized automatically; tick Ignore whitespace for indentation differences.
Can I get a patch file?
Not from this page: it shows the differences on screen and lets you copy either text, but it does not write a unified diff. Save both versions as files and run diff -u original.txt changed.txt > changes.patch, then apply the result with git apply or the patch command.
Is there a size limit?
There is no fixed limit, but very large texts with many changes take longer to compare because everything runs in your browser.

Last updated October 3, 2026

Related tools

File Diff - Compare Files Compare two files online and see line-by-line differences side by side or in a unified view, with the changed characters highlighted. JSON Diff - Compare JSON Compare two JSON documents semantically: find added, removed and changed keys with JSON paths, ignoring key order and formatting. XML Diff - Compare XML Compare two XML documents after normalising indentation and line breaks, and highlight changed elements side by side. Add Line Numbers Number every line of text: choose the start number, step, format (1. 1) 1:), zero padding, and whether empty lines get a number. Add Prefix and Suffix to Lines Add text to the start and end of every line at once: quote list items, add bullets, commas or HTML tags. Skip empty lines, trim spaces. Alphabetical Order Put a list into alphabetical order (A–Z or Z–A), optionally ignoring leading articles like "The". ASCII Art Text Generator (FIGlet) Turn text into large ASCII art banners with 30 FIGlet fonts. Wrap them as code comments for README files, CLIs and source headers. Atbash Cipher Encode and decode the Atbash cipher, which mirrors the alphabet (A↔Z, B↔Y). Running it twice returns the original text. Caesar Cipher Encoder / Decoder Encrypt and decrypt Caesar shift ciphers with any shift, or brute-force all 25 shifts with automatic English detection. Case Converter Convert text to UPPER, lower, Title, Sentence, camelCase, snake_case, kebab-case, PascalCase and more. Compare PDF Compare the text of two PDFs and see every added, removed and changed sentence side by side. Ignores line breaks. No upload. Compare CSV Files Compare two CSV files by key column or row position: see added, removed and changed rows with old and new values, then export the differences.