Free Online Text & Code Diff Tool
Compare texts with char-level highlighting, side-by-side view, and 3-way merge.
About the Text & Code Diff Tool
A diff tool compares two blocks of text or code and highlights exactly what changed — insertions, deletions, and modifications — down to the character level. This is the same operation Git performs on every commit, brought to your browser without any server round-trip. Paste two versions of a config file, a SQL query, a JSON payload, or any text and see the differences instantly.
What this tool does
Unified & Side-by-Side Views
Switch between Git-style unified output and a parallel side-by-side layout. Both show character-level highlights within changed lines.
Syntax Highlighting
Auto-detects language or lets you choose from 20+ options. Prism.js highlights tokens so you can see which identifiers or values changed.
Ignore Options
Ignore whitespace, case differences, or blank lines to focus on meaningful changes and reduce noise in the output.
Export
Download the diff as a .patch file or as a self-contained HTML report you can share with teammates.
Common use cases
- Comparing two versions of a config file before deploying
- Reviewing API response changes between environments
- Spotting unintended changes in generated SQL or JSON
- Checking what changed in a minified file after a build
Pipeline
- JSON Formatter — format both payloads before diffing for a cleaner result.
- JSON / YAML Converter — normalize formats before comparing.
Privacy
All processing runs in your browser. Your text is never sent to any server. Read our privacy policy.
Frequently asked
- Is my text sent to a server?
- No. The diff algorithm runs entirely in your browser using a Web Worker for large files. Nothing is uploaded or transmitted.
- What diff algorithm does this tool use?
- The Myers diff algorithm — the same algorithm used by Git. It finds the shortest edit script (minimum insertions and deletions) between two texts, which produces the most human-readable diff.
- What is the difference between unified and side-by-side view?
- Unified view shows both texts interleaved in a single column with + and - markers, like git diff output. Side-by-side view shows the two texts in parallel columns, making it easier to compare corresponding lines visually.
- How large a file can I diff?
- Files up to ~100,000 lines are supported. For inputs over 50 KB the diff runs in a Web Worker to keep the UI responsive. Very large files may take a few seconds to process.
- Can I diff code with syntax highlighting?
- Yes. Enable syntax highlighting and select the language (or use auto-detect). The tool uses Prism.js to highlight tokens within changed lines so you can see exactly which identifiers or values changed.