Copied!
Developer Tool

Text Diff Checker — Compare Two Texts

Compare two texts side by side and instantly find every difference. This free online diff checker highlights additions, deletions, and unchanged lines using a line-by-line comparison algorithm. Works with any text format — code (JavaScript, Python, Go), data formats (JSON, XML, YAML), configuration files, or plain text. Similar to git diff but in your browser. All processing runs client-side — nothing is uploaded to a server.

text-diff.tool
Original
Modified
Click "Compare" to see differences...

Frequently Asked Questions

How do I compare two text files online?
Paste the original text in the left panel and the modified text in the right panel, then click "Compare." The diff checker highlights additions (green with +), deletions (red with −), and unchanged lines. You can compare code, JSON, XML, HTML, config files, or any plain text. All comparison happens in your browser — nothing is uploaded to any server.
What is a diff checker and how does it work?
A diff checker compares two texts line by line and identifies differences using algorithms like the longest common subsequence (LCS). Lines present only in the original are marked as deletions (−), lines only in the modified version are additions (+), and matching lines remain unchanged. This is the same concept behind git diff, GitHub pull request reviews, and code review tools.
What is the difference between unified diff and side-by-side diff?
Unified diff shows changes in a single column with + and - prefixes — this is what git diff produces. Side-by-side diff shows original and modified text in parallel columns. Unified is more compact and commonly used in terminals, patches, and email; side-by-side is better for visual code reviews. This tool shows unified-style output.
Can I compare JSON files with this tool?
Yes. Paste both JSON documents into the panels and click Compare. For best results, pretty-print both JSON objects first so structural changes appear on separate lines. Use our JSON Formatter to format JSON before comparing — this ensures keys and values are on individual lines, making the diff much more readable.
Is my data safe when comparing texts?
Yes. All comparison processing happens entirely in your browser using JavaScript. No text is ever sent to a server, stored, or logged. The tool works fully offline once loaded. You can safely compare sensitive code, configuration files, API responses, and credentials without privacy concerns.