Diff Checker: Find Differences in Text
Text diff checker: compare two texts side by side with color-coded additions, deletions, and unchanged lines. Works instantly.
What Is Diff Checker?
Diff Checker is a free online tool that compares two blocks of text and highlights every difference between them. Paste your original text on the left and the modified version on the right, and the tool immediately shows you exactly what was added, deleted, or left unchanged — down to the character level.
The tool solves a common problem for developers, writers, and anyone who needs to audit changes: manually reading through two similar texts to find divergences is slow and error-prone. Diff Checker automates that work using the diff-match-patch algorithm, the same technique used by professional code review systems. Processing happens entirely in your browser — no text is transmitted to a server, so it is safe for confidential documents, source code, and proprietary data.
Key Features
- Side-by-side text comparison — The default view places Original on the left and Modified on the right so you can visually track where lines diverged. Both panes are scrollable and independently resizable.
- Line-by-line diff highlighting — Each line is colour-coded: green background for insertions, red background for deletions, and no background for unchanged content. Line numbers appear next to every line in both panes.
- Character-level diff detection — The underlying
diff-match-patchlibrary uses a semantic cleanup pass (diff_cleanupSemantic) after computing the raw diff. This means the tool groups related changes into the most human-readable units rather than splitting words arbitrarily. - Inline view toggle — Click the view-toggle button to switch from the two-column layout to a single continuous stream showing deletions and insertions interleaved in document order. Useful when you care about sequence more than side-by-side alignment.
- Swap texts — One click exchanges the content of both panes, so you can flip which version is treated as the original.
- Copy diff results — Copies the diff in unified-diff format (lines prefixed with
+,-, or two spaces) ready to paste into a ticket, email, or commit message. - Live character statistics — A status bar shows the total count of added characters, removed characters, and unchanged characters, updating in real time as you type.
How to Use Diff Checker
Step 1: Paste your original text
Click the left textarea labelled "Text A" and paste or type the baseline version of your content. This is the text you are comparing from. The textarea accepts plain text, code, configuration files, JSON, or any other character-based content.
Step 2: Paste your modified text
Click the right textarea labelled "Text B" and paste the newer or altered version. The tool begins computing the diff as soon as both fields contain content — there is no submit button to press.
Step 3: Read the diff output
Scroll down past the action bar to the "Differences" panel. In side-by-side mode you will see:
- Original pane on the left — lines that were removed appear in red
- Modified pane on the right — lines that were added appear in green
- Lines present in both versions appear without any background colour
Each line carries a line number on the left edge. The numbers are independent per pane: if three lines were deleted from the original, the Modified pane's numbering will be lower than the Original pane's at that point.
Example: comparing two versions of a JSON configuration:
Text A (original):
{
"timeout": 30,
"retries": 3,
"endpoint": "https://api.example.com/v1"
}
Text B (modified):
{
"timeout": 60,
"retries": 5,
"endpoint": "https://api.example.com/v2",
"auth": "bearer"
}
The diff output highlights 30 → 60, 3 → 5, v1 → v2, and the newly inserted "auth" line in green.
Step 4: Switch to inline view if needed
Click the view-toggle button in the action bar. The label reads "Inline" when you are in side-by-side mode (clicking switches to inline) and "Side by Side" when you are in inline mode. In inline view, all lines appear in document order: deleted lines in red immediately followed by their replacement lines in green.
Step 5: Copy or clear
Click "Copy Diff" to copy the result in unified diff format. Each deleted segment is prefixed with - and each inserted segment with + , making the output compatible with patch tools and documentation. Click "Clear" to empty both text areas and start a new comparison. Use "Swap" to flip the two texts when you want to reverse the direction of the comparison.
Practical Examples
Reviewing configuration changes before deployment
A DevOps engineer has two versions of a Kubernetes ConfigMap and needs to confirm only the resource limits changed before promoting to production. They paste the current YAML into Text A and the proposed YAML into Text B. The diff highlights the two changed lines (cpu: "250m" → cpu: "500m" and memory: "256Mi" → memory: "512Mi") against dozens of unchanged lines, confirming the scope of the change in seconds.
Auditing a contract revision
A paralegal receives a revised service agreement and needs to identify every change from the signed original. Pasting both versions into the diff checker highlights every altered phrase in red and green. Switching to inline view makes it easy to read the document in order and spot whether any critical clauses were silently reworded.
Debugging an unexpected test failure
A developer's test suite started failing after a colleague merged a feature branch. They copy the expected output string from the test fixture into Text A and the actual output from the test runner into Text B. The character-level diff reveals a trailing newline difference that is invisible in a normal text editor — a quick fix that would have taken much longer to find manually.
Tips and Best Practices
Use the character statistics to gauge change scope. The green +N added and red -N removed counters at the right of the action bar measure characters, not lines. A high deletion count relative to additions often means content was rewritten rather than appended. This gives you a quick signal before reading the full diff.
Inline view is better for narrative text. When comparing prose, documentation, or legal text, the inline view preserves reading flow. Side-by-side view is better for code where line alignment matters.
Whitespace counts. The diff engine treats spaces and tabs as meaningful characters. If you get unexpected differences in code, check whether your editor introduced trailing whitespace or changed indentation from tabs to spaces.
Swap to generate a reverse patch. If you want to revert a change, click Swap to flip Text A and Text B. The resulting diff can be read as "what would need to change to go back to the original."
Resize the textareas. Both input panes have a resize-y handle at the bottom-right. Drag it down for long documents to reduce scrolling.
Common Issues and Troubleshooting
"The diff output shows every line as changed." This usually means the two texts use different line endings (CRLF vs LF). Windows applications often produce \r\n while Unix tools produce \n. Paste your text through a plain-text editor that normalises line endings before comparing.
"The Copy Diff button is disabled." The button is only enabled when diffResult is non-null — meaning at least one of the two text fields must contain content. Ensure you have pasted text into both fields.
"Line numbers seem mismatched between panes." This is expected behaviour, not a bug. When lines are deleted from the original or inserted in the modified version, the numbering in each pane counts independently. The numbers reflect the actual line position within that version of the document.
"Long lines overflow the output pane." The output uses whitespace-pre-wrap and break-all to handle very long lines. If a single line still appears to extend past the visible area, use horizontal scroll within the output pane, or switch to inline view.
"The diff is splitting words in unexpected places." The diff_cleanupSemantic pass groups changes to produce human-readable boundaries, but very short words or repeated characters can still produce granular splits. This is a property of the diff algorithm rather than an error.
Privacy and Security
All comparison processing runs locally in your browser using the diff-match-patch JavaScript library. Neither Text A nor Text B is sent to any server at any point. The tool works without an internet connection once the page has loaded. This makes it safe to use with source code, credentials files, legal documents, medical records, or any other sensitive content that should not leave your device.
Frequently Asked Questions
Is Diff Checker free? Yes, completely free with no usage limits. There is no account, subscription, or payment required to use any part of the tool.
Does it work offline? Once the page has loaded, the comparison engine runs entirely in your browser with no network requests. You can disconnect from the internet and continue comparing texts without interruption.
Is my data safe? Your text never leaves your browser. The diff is computed in-browser using JavaScript, so no content is sent to Glyph Widgets servers or any third party. It is safe for confidential source code, contracts, and sensitive configuration files.
What is the maximum text size it can handle? There is no hard limit enforced by the tool. Browser memory is the practical constraint. Texts up to several megabytes compare quickly; very large files (tens of megabytes) may cause the page to slow down depending on your device.
Can it compare code files? Yes. The tool handles any plain-text content including JavaScript, Python, SQL, HTML, CSS, JSON, YAML, Markdown, and configuration files. It does not apply language-specific parsing — it treats all input as plain text, which means the diff is character-accurate across any file type.
What is the difference between side-by-side and inline view? Side-by-side shows Original on the left and Modified on the right simultaneously, letting you compare corresponding sections at a glance. Inline view shows a single stream of text where deleted segments and inserted segments appear sequentially at the point of change. Inline view is often easier to read for prose; side-by-side is easier for code.
What format does "Copy Diff" produce? The copied text uses a simplified unified diff format: lines prefixed with - are deletions, lines prefixed with + are insertions, and unchanged lines are prefixed with two spaces. This format is broadly compatible with diff viewers, documentation tools, and patch utilities.
Can I swap the two texts without retyping? Click the "Swap" button in the action bar. It exchanges the content of Text A and Text B instantly. The diff immediately recalculates to reflect the reversed direction.
Does it detect moved blocks, or just additions and deletions? The diff-match-patch algorithm treats a moved block as a deletion in the original position and an insertion at the new position. It does not have a dedicated "move" detection mode.
Can I save my comparison for later? The tool does not persist comparisons between sessions by default. Premium supporters can use the History panel to restore previous comparison inputs automatically.
Related Tools
JSON Formatter — Format and validate JSON before comparing two versions with Diff Checker.
Text Diff — A text-focused variant suited for comparing prose documents and written content.
JSON Formatter — Normalise JSON formatting before diffing to avoid whitespace noise in your results.
Try Diff Checker now: Diff Checker