Compare two text files side-by-side or in unified view with character-level highlighting.
Features
- Two View Modes: Side-by-side split view or unified diff view
- Character-level Highlighting: See exactly which characters changed within modified lines
- Smart Options: Ignore whitespace or case differences
- File Support: Upload files or drag-and-drop (up to 5MB)
- Save & Share: Save diffs to browser storage or share via URL
- Keyboard Shortcuts: Fast navigation and actions
- Privacy First: All processing happens in your browser, no server upload
How to Use
- Paste or Upload: Enter text in both panels (Original and Changed), or upload/drag-drop files
- Configure Options: Toggle ignore whitespace, ignore case, or character-level diff
- Compare: Click "Compare" or press Ctrl+Enter
- Review: View results in split or unified mode
- Navigate: Use Prev/Next buttons or arrow keys to jump between change hunks
- Export: Download as .patch file or copy unified diff to clipboard
Keyboard Shortcuts
| Shortcut | Action |
|---|---|
Ctrl+Enter | Compare texts |
Ctrl+S | Save current diff |
Ctrl+L | Clear all inputs |
↑ / ↓ | Navigate between hunks |
Escape | Close sidebar/dialogs |
View Modes
Side-by-Side (Split)
Shows original text on the left and changed text on the right in synchronized columns. Modified lines show character-level highlighting with colored marks.
Unified
Shows all changes in a single column with + (added), - (removed), and (unchanged) prefixes, similar to Git diff output.
Diff Options
Ignore Whitespace: Treats lines as equal if they only differ in leading/trailing spaces or indentation.
Ignore Case: Case-insensitive comparison (e.g., "Hello" equals "hello").
Character-level Diff: Highlights individual character changes within modified lines (enabled by default).
Save & Share
Save to Browser
Click "Save" to store diffs in your browser's local storage (max 50 diffs). Saved diffs appear in the sidebar for quick loading.
Privacy Note: Saved diffs are stored locally on your device only and never leave your browser.
Share via URL
Click "Share URL" to encode the diff in the page URL hash. Copy the URL to share with others.
Limitation: Very large diffs (>2000 characters) cannot be shared via URL due to browser limits. Use "Save" or "Download" instead.
File Upload
Supported formats: Any text file (.txt, .js, .html, .css, .json, .md, .log, etc.)
Size limit: 5MB per file
Encoding: UTF-8 recommended. Binary files show "Binary files differ" message.
Technical Details
- Algorithm: Myers diff algorithm for optimal line-level comparison
- Execution: Pure client-side JavaScript, no server processing
- Storage: Browser localStorage API (persistent across sessions)
- Encoding: URL sharing uses base64 encoding
Browser Compatibility
Works in all modern browsers:
- Chrome/Edge 90+
- Firefox 88+
- Safari 14+
Requires JavaScript enabled.
Limitations
- Maximum 10,000 lines per input (for performance)
- Maximum 10,000 characters per line
- URL sharing limited to ~2000 characters total
- No syntax highlighting (planned for future version)
- No patch application or merge conflict resolution
FAQ
Q: Is my data sent to a server?
A: No. All diff processing happens entirely in your browser. Nothing is uploaded.
Q: Can I diff code with syntax highlighting?
A: Not yet. Syntax highlighting is planned for a future version.
Q: What's the difference between this and the legacy Text Diff tool?
A: This tool has a modern UI, character-level highlighting, file upload, save/share features, and better performance.
Q: Can I use this for large files?
A: The tool is optimized for code files and documents up to ~1MB. Very large files (>5MB) are rejected.
Q: Does it work offline?
A: Yes, once the page loads, all functionality works offline.
Use Cases
- Compare two versions of code files
- Review document changes
- Check log file differences
- Verify configuration changes
- Compare API responses
- Review text-based data exports
Built with ToolNexus | Privacy-first, client-side tools