Diff Checker — Compare Two Texts or JSON Files Side by Side

Compare two versions of a text, code or JSON file and see exactly which lines, words and characters changed.

Found a problem, or something that could be better? We read every message and we fix things quickly.

This free diff checker compares two texts and shows what changed, line by line, with the changed words or characters highlighted inside each line. Use it to compare two drafts of a contract, two versions of a config file, an edited article against the original, or two API responses. Switch between side-by-side and unified views, and ignore whitespace or case when those differences do not matter.

JSON mode parses both sides and compares the data rather than the text, so reordered keys are not reported as changes and every real difference is listed by path, such as $.scripts.dev changed from “next dev” to “next dev -p 3300”. Both texts stay in your browser. The diff uses the Myers algorithm (the one behind git diff and GNU diff) and runs with a time limit, so pasting two 5,000-line files does not lock up the page; inputs that differ almost everywhere are reported as too different rather than spinning forever.

How to use

  1. Paste the original text on the left and the changed text on the right. The comparison runs as you type.
  2. Read the counts of added and removed lines, then scan the highlighted rows. Red is removed, green is added; the darker highlight marks the exact words that changed.
  3. Turn on Ignore whitespace for re-indented code, or Ignore case if capitalization does not matter.
  4. Switch to JSON mode to compare two JSON documents by structure and get a list of changed paths.
  5. Copy or download the result as a plain diff, or press Swap sides to reverse the comparison.

Frequently asked questions

How do I compare two texts for differences?

Paste one version in the Original box and the other in the Changed box. Lines that were removed are shown in red, added lines in green, and lines that changed in both colours with the changed words highlighted. Unchanged stretches are collapsed so you can jump between changes; turn off Collapse unchanged lines to see everything.

What is the difference between side-by-side and unified diff?

Side by side puts the two versions in parallel columns, which is easiest to read for prose and short lines. Unified shows one column, with removed lines marked − and added lines marked +, which is the format git and patch files use and works better on narrow screens. Both views show the same changes.

Can I compare JSON files and ignore key order?

Yes. Switch to JSON mode. Both sides are parsed, and objects are compared key by key regardless of the order keys appear in, while arrays are compared position by position, because order in an array is usually meaningful. You get a table of every added, removed and changed path, plus a line diff of both documents re-indented with sorted keys.

What does ignore whitespace do?

It treats any run of spaces and tabs as a single space and ignores spaces at the start and end of lines when deciding whether two lines match. That hides indentation changes and trailing spaces, which is useful when code was reformatted. Lines are still displayed exactly as you pasted them.

Is there a size limit?

No fixed limit. Files of several thousand lines compare in well under a second on a laptop, and long runs of unchanged lines are folded so the page stays fast. If two large inputs differ on almost every line, the comparison stops after a few seconds and tells you, instead of freezing the tab.

Is my text uploaded?

No. The comparison runs in JavaScript in your browser, and nothing you paste is sent to a server or stored. That makes it suitable for contracts, source code and configuration files with secrets, though the usual caution about what you paste into any website still applies.

How a diff is computed

A diff finds the longest sequence of lines the two versions have in common, in order, and reports everything else as removed or added. This tool uses Eugene Myers' 1986 O(ND) algorithm through the jsdiff library: it is fast when the two texts are similar (D, the number of differences, is small) and slower as they diverge, which is why a time limit is applied.

A changed line is really a removed line followed by an added line. When a block of removals sits next to a block of additions, the tool pairs them up line by line and runs a second, finer diff inside each pair, at the word or character level. Word level suits prose and most code; character level shows a one-letter typo or a changed digit precisely.

Typical uses

• Contracts and policies: see exactly which clauses a counterparty edited without relying on their change summary.

• Content edits: compare a published article with the editor's revision before approving it.

• Configuration: compare a working and a broken config file, or a staging and a production environment file.

• API responses: paste two JSON responses in JSON mode to see which fields changed between versions.

• Lists: compare two exports of email addresses or SKUs. Sort both first with the text cleaner so the order does not create noise.

Related free tools

  • Text Cleaner — Remove line breaks, extra spaces, duplicates and invisible characters, sort lines, and find and replace, in one pass.
  • JSON Formatter — Pretty-print, minify and validate JSON, with parse errors located by line and column. In your browser, no upload.
  • Case Converter — Switch text between twelve cases in one click, from UPPER and Sentence case to camelCase, snake_case and kebab-case.
  • Word Counter — Count words, characters, sentences and reading time, and check X, LinkedIn, Instagram, YouTube, SEO and SMS limits as you type.