Text Diff Online — Compare Two Texts & Highlight Differences
A free online text diff tool that compares two pieces of text side by side and highlights every insertion, deletion, and change. Use it for code review, contract redlining, log analysis, or spotting AI-generated edits. The diff runs entirely in your browser, so source code, contracts, and other sensitive content never leave your device.
Features
Line-level diff
Spot added, removed, and changed lines at a glance with red/green highlights.
Word-level granularity
Zoom into changed lines to see exactly which words or tokens were modified.
Side-by-side or inline
Switch between split and unified views to match your reading style.
Whitespace-aware
Toggle ignore-whitespace to filter out trivial reformatting noise.
How to compare two texts online
Diff any two text blocks in three steps.
- Paste the original textDrop the first version into the left editor pane.
- Paste the modified textDrop the second version into the right editor pane.
- Read the highlighted diffRemoved segments are red, additions are green, and changed segments are highlighted in both columns.
- Toggle optionsSwitch view modes or ignore whitespace if your inputs only differ in indentation.
Examples
Compare two JSON snippets
Input
{ "name": "Alice", "role": "user" }Output
{ "name": "Alice", "role": "admin" }The diff highlights "user" → "admin" as a change while leaving the name unchanged.
Frequently Asked Questions
- Does this text diff tool send my content anywhere?
- No. Both inputs are diffed in your browser using JavaScript — nothing is uploaded, logged, or cached on a server.
- Can I compare large files?
- Yes. The diff scales to hundreds of thousands of lines on modern machines. Very large inputs may slow the UI but will still produce a correct result.
- What algorithm is used?
- The tool uses the Myers diff algorithm, the same algorithm Git uses, which produces minimal and human-readable diffs.
- Can I diff JSON or YAML?
- Yes. The tool treats input as plain text, so it works for any line-based format including JSON, YAML, CSV, configuration files, and source code.
- How do I ignore whitespace differences?
- Enable the "ignore whitespace" option to skip lines that only differ in indentation, trailing spaces, or newlines.
- Is there a length limit?
- There is no hard limit. The browser handles all the work, so the practical limit is your machine's memory.