Features

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

Side-by-side view

Paste or upload into two editors for a live split diff. Scroll is synchronised between panels so context is never lost.

Word-level diff

See exactly which words or characters changed within a line perfect for proofreading documents or reviewing config values.

Syntax highlighting

Supports 17 languages: JavaScript, TypeScript, Python, PHP, HTML, CSS, JSON, XML, SQL, YAML, Shell, Java, C/C++, Markdown, INI, and plain text.

Auto language detection

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.

Inline unified view

Switch to a single-column unified view with + / − markers for a Git-style experience alongside the side-by-side view.

Auto compare

Enable Auto mode to re-diff continuously as you type no button click needed. Ideal for live editing sessions.

Collapse identical lines

Hide unchanged blocks to focus only on what actually changed. Context depth is configurable: 0, 3, 5, 10, or all lines.

Live line & char count

The status bar shows real-time line and character counts for both panels useful for spotting size discrepancies before comparing.

Merge & text controls

Smart merge

Patch-based merge applies changes intelligently handles complex diffs without data loss. Result is editable and exportable.

Directional merge

Merge left → right or right → left with one click. Undo is always available via the toolbar or Ctrl+Z.

Swap panels

Swap both content and file names between panels instantly with Ctrl+S. Re-diffs automatically if compare mode is active.

Line wrap toggle

Toggle line wrapping with Alt+W or the Wrap button applies to both edit panels and the compare view simultaneously.

Undo & redo

Multi-level undo and redo per panel. Targets whichever panel you last clicked in or both if neither is focused.

Diff chunk navigation

Jump between changed chunks with Alt+↓ / Alt+↑ or the ↓ Diff / ↑ Diff buttons works in all view modes.

Find & Replace

Inline search bar

Open with Ctrl+F or the Search button. Searches both panels simultaneously and highlights all matches at once.

Case-sensitive & regex

Toggle case sensitivity with the Aa checkbox, or enable full regular expression matching with the .* checkbox.

Replace one or all

Replace the current match or replace every occurrence in the focused panel at once. The panel last clicked is always the replace target.

Match counter

Shows the current match position and total count (e.g. 3 / 12) as you navigate with ↑ / ↓ or Enter / Shift+Enter.

Export & save

Unified diff patch

Download a standard .patch file compatible with Git, SVN, and other version control tools.

HTML diff report

Save a self contained, styled HTML report with colour coded rows shareable and archivable without any dependencies.

Copy diff to clipboard

Instantly copy the unified diff output for pasting into GitHub issues, emails, Slack, or pull request descriptions.

Save panel as file

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 & drop files

Drag a file from your desktop directly onto the left or right panel. A visual drop-zone overlay confirms the target panel.

File picker upload

Click the Upload button on each pane header, or use Ctrl+U for the left panel. Accepts all 17 supported language extensions.

Auto mode detection from extension

Uploading a .ts file automatically switches to TypeScript mode. Uploading .yml switches to YAML. No manual selection needed.

Themes, accessibility & performance

Dark & light mode

Theme persists across sessions via localStorage. CodeMirror's Dracula theme activates in dark mode for comfortable night time coding.

Adjustable font size

A+ / A− buttons in the advanced toolbar change the editor font size on the fly applies to both panels and the compare view.

Fully responsive

Works on desktop, tablet, and mobile. Panels stack vertically on narrow screens. All features including upload and export work on mobile.

Keyboard shortcuts

Ctrl+Enter compare, Ctrl+S swap, Ctrl+F search, Alt+↓/↑ navigate diffs, Ctrl+Alt+→/← merge, and more. Press ? for the full list.

Session persistence

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.

100% private & fast

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.