FormatterHQ

Diff & Compare

Compare text, files, JSON and XML side by side and highlight every addition, deletion and change, with unified patches you can download.

Compare anything, see exactly what changed

Finding the difference between two versions by eye is slow and error-prone, especially in long documents or deeply nested data. These diff tools compare two inputs and highlight every change, from a single edited word to reordered sections. There is a tool for plain text and files, and structure-aware tools for JSON and XML that ignore meaningless differences such as indentation and key order.

Which diff tool should you use?

You are comparingUseWhy
Documents, code snippets, listsDiff checkerLine and word-level highlighting, side-by-side or unified view
Two files from diskFile diffLoads files and produces a downloadable patch with context lines
API responses, configs in JSONJSON diffCompares values by path; ignores key order and formatting
XML feeds, SOAP, project filesXML diffNormalizes formatting and attribute order first

Reading a diff

  • Lines marked with - (usually red) exist only in the original.
  • Lines marked with + (usually green) exist only in the new version.
  • A removed and an added line at the same place are shown as a changed line, with the differing words highlighted.
  • In JSON diff, paths like $.items[2].price tell you exactly where a value changed.

Options that reduce noise

Real-world comparisons often suffer from irrelevant differences. Ignore whitespace to hide re-indentation, ignore case for case-insensitive content, and trim trailing spaces that editors add invisibly. Line endings from Windows and Unix are normalized automatically. For data, the JSON and XML tools remove formatting differences entirely by comparing structure.

Typical uses

  • Reviewing edits to contracts, policies and articles.
  • Finding configuration drift between staging and production.
  • Checking what changed in an API response after a release.
  • Verifying that a refactoring or format conversion did not change content, for example after running the JSON formatter.

Prepare inputs for cleaner diffs

Differences are easiest to read when both sides are formatted the same way. Run both versions through the XML formatter or a code formatter first, or clean prose with the text formatter, so layout changes do not hide the edits that matter. For sorted lists, sort both sides before comparing to see only real additions and removals.

Privacy

Comparisons run entirely in your browser, so confidential documents and source code are never uploaded. For long texts with many changes, a desktop tool or Git may be faster, but for quick comparisons nothing beats pasting two versions side by side.

Frequently asked questions

How do I compare two texts for differences?
Paste the original into the left side of the diff checker and the new version into the right. Added, removed and changed lines are highlighted, with word-level detail inside changed lines.
Why use a JSON diff instead of a text diff?
JSON diff compares the data structure, so reordered keys or different indentation are not reported as changes. You only see real differences in values, with their paths.
Can I get a patch file?
Yes. The text and file diff tools produce a unified diff that you can download and apply with git apply or the patch command.
Are my files uploaded?
No. All comparisons happen in your browser, so documents and code stay on your device.