Free Online Diff Tool

Compare Text, JSON & XML — Find Every Difference

Paste two versions of any text, JSON, or XML file and instantly see what changed, what was added, and what was removed. Inline word-level highlighting. One-click beautify. No upload needed.

Start Comparing 100% free · No sign-up · Runs in browser
LCSDiff Algorithm
3Formats
LiveReal-time
FreeAlways

Everything You Need to Compare Files

Real-Time Diff

Differences update automatically as you type — no button needed. See changes instantly with 350ms debounce for smooth performance.

🔍

Word-Level Highlighting

Changed lines show exactly which words were added or removed, not just the whole line. Makes spotting typos and small edits effortless.

🌿

JSON & XML Beautify

One-click beautify auto-detects and formats JSON or XML in both panels before comparing — perfect for comparing minified API responses.

📐

Split & Unified Views

Switch between side-by-side split view (great for wide screens) and unified view (like Git diff) with a single click.

🔒

100% Private

All comparison happens in your browser using JavaScript. Your text never leaves your device — safe for API keys, configs, and private data.

🔄

Swap & Reset

Instantly swap left and right panels to reverse the diff direction. One-click clear to start fresh with new content.

Text & JSON Diff

Original Text
Modified Text
🔍

Paste content in both panels above to see differences

How to Use DiffKit

1

Paste Both Versions

Paste the original content in the left panel and the modified version in the right. Works with plain text, JSON, XML, YAML, CSV, or any config file.

2

Beautify if Needed

Click Beautify to auto-format JSON or XML in both panels before comparing — ideal for minified API responses or one-liner configs.

3

Read the Diff

Green lines were added, red lines were removed. Unchanged lines are neutral. Switch to Unified view for a Git-style diff output.

What Is a Diff Tool?

A diff tool compares two pieces of text and shows exactly what changed between them. It's named after the Unix diff command, which has been a core tool for developers since the 1970s. DiffKit brings the same power to your browser with a clean visual interface.

Developers use diff tools to review code changes, compare API responses, track configuration file updates, and verify that a refactored function behaves identically to the original. Content editors use them to track document revisions. DBAs use them to compare query results or schema exports.

DiffKit uses the Longest Common Subsequence (LCS) algorithm — the same foundation used by Git — to find the minimal set of changes between two texts. Changes within a line are then highlighted at the word level so you can see exactly which words changed, not just which lines.

Frequently Asked Questions

What file formats does DiffKit support?

DiffKit works with any plain text format: JSON, XML, YAML, CSV, Markdown, HTML, code, config files, SQL, and more. The Beautify button specifically formats JSON and XML. For other formats, the line-by-line diff always works.

Is there a file size limit?

DiffKit handles up to 600 lines per panel for the diff algorithm. Larger inputs are truncated with a notice. For very large files, consider using a desktop tool like VS Code's built-in diff view or git diff.

What does the Beautify button do?

It auto-detects the format of each panel (JSON or XML) and reformats it with proper indentation and line breaks. This is especially useful when comparing minified JSON from an API — beautify both sides first, then the diff shows meaningful changes.

What's the difference between Split and Unified view?

Split view shows both versions side-by-side with matching lines aligned — great for wide screens. Unified view shows everything in one column with + for added lines and - for removed lines, similar to git diff output.

Is my data sent to a server?

No. All comparison, formatting, and highlighting happens entirely in your browser using JavaScript. Nothing is uploaded or stored. You can safely diff API keys, passwords, private configs, or any sensitive data.

Can I compare JSON objects and see which keys changed?

Yes — click Beautify first to expand the JSON into multi-line format, then the diff shows exactly which keys and values changed line by line, with inline highlighting for changed values.