Everything you need to diff text
TextFileCompare.com is your all-in-one free online diff tool. Smart merging, syntax highlighting, auto language detection, and instant comparison for developers, writers, and anyone working with text.
Core comparison
Paste or upload into two editors for a live split diff. Scroll is synchronised between panels so context is never lost.
See exactly which words or characters changed within a line perfect for proofreading documents or reviewing config values.
Supports 17 languages: JavaScript, TypeScript, Python, PHP, HTML, CSS, JSON, XML, SQL, YAML, Shell, Java, C/C++, Markdown, INI, and plain text.
Set the selector to Auto detect and the tool analyses your code content to pick the right syntax mode automatically. A quiet badge confirms what was detected.
Switch to a single-column unified view with + / − markers for a Git-style experience alongside the side-by-side view.
Enable Auto mode to re-diff continuously as you type no button click needed. Ideal for live editing sessions.
Hide unchanged blocks to focus only on what actually changed. Context depth is configurable: 0, 3, 5, 10, or all lines.
The status bar shows real-time line and character counts for both panels useful for spotting size discrepancies before comparing.
Merge & text controls
Patch-based merge applies changes intelligently handles complex diffs without data loss. Result is editable and exportable.
Merge left → right or right → left with one click. Undo is always available via the toolbar or Ctrl+Z.
Swap both content and file names between panels instantly with Ctrl+S. Re-diffs automatically if compare mode is active.
Toggle line wrapping with Alt+W or the Wrap button applies to both edit panels and the compare view simultaneously.
Multi-level undo and redo per panel. Targets whichever panel you last clicked in or both if neither is focused.
Jump between changed chunks with Alt+↓ / Alt+↑ or the ↓ Diff / ↑ Diff buttons works in all view modes.
Find & Replace
Open with Ctrl+F or the Search button. Searches both panels simultaneously and highlights all matches at once.
Toggle case sensitivity with the Aa checkbox, or enable full regular expression matching with the .* checkbox.
Replace the current match or replace every occurrence in the focused panel at once. The panel last clicked is always the replace target.
Shows the current match position and total count (e.g. 3 / 12) as you navigate with ↑ / ↓ or Enter / Shift+Enter.
Export & save
Download a standard .patch file compatible with Git, SVN, and other version control tools.
Save a self contained, styled HTML report with colour coded rows shareable and archivable without any dependencies.
Instantly copy the unified diff output for pasting into GitHub issues, emails, Slack, or pull request descriptions.
Download either panel as a file. When you upload a file, its original filename is remembered and used as the default save name.
Upload & drag-drop
Drag a file from your desktop directly onto the left or right panel. A visual drop-zone overlay confirms the target panel.
Click the Upload button on each pane header, or use Ctrl+U for the left panel. Accepts all 17 supported language extensions.
Uploading a .ts file automatically switches to TypeScript mode. Uploading .yml switches to YAML. No manual selection needed.
Themes, accessibility & performance
Theme persists across sessions via localStorage. CodeMirror's Dracula theme activates in dark mode for comfortable night time coding.
A+ / A− buttons in the advanced toolbar change the editor font size on the fly applies to both panels and the compare view.
Works on desktop, tablet, and mobile. Panels stack vertically on narrow screens. All features including upload and export work on mobile.
Ctrl+Enter compare, Ctrl+S swap, Ctrl+F search, Alt+↓/↑ navigate diffs, Ctrl+Alt+→/← merge, and more. Press ? for the full list.
Text, settings, language mode, and file names are auto saved in your browser's session storage. Reload the page and continue exactly where you left off.
All computation is client-side JavaScript. Files never leave your device. Handles 5,000+ line files smoothly with a hybrid viewport rendering strategy.
Language-specific comparison pages
Each language has a dedicated page with tailored SEO content, pre-set syntax mode, and relevant use-case examples.
Not sure where to start? Read the step-by-step guide.
Want to know more? Visit the about page.
Questions or feedback? Contact us.