Compare Two Text Files Online — Free File Diff Tool
Upload or drag-and-drop two text files to instantly compare them side-by-side. TextCompare reads your files entirely in the browser — no server upload, no account, no waiting. Supports .txt, .csv, .json, .md, code files, and 20+ other formats.
How to Compare Files by Uploading
Comparing text files is simple: click the upload icon in the top-right corner of either panel to browse for a file, or drag a file from your desktop and drop it anywhere inside the panel. You can upload one file and paste the other, or upload both files simultaneously. The file content is read locally by your browser using the standard File API — no bytes ever leave your device. This makes TextCompare safe for comparing sensitive configuration files, private documents, and confidential data.
Once both panels contain content, click Compare (or press Ctrl+Enter) to run the diff. TextCompare will highlight additions in green, removals in red, and changed lines in amber. Switch between side-by-side and unified view using the toggle above the results. You can also use the Ignore whitespace or Trim lines options to filter out indentation and spacing differences — especially useful when comparing reformatted files.
For code files in particular, the Code Diff Checker adds tab-expansion controls and code-friendly defaults. For JSON files, the JSON Diff Checker includes automatic formatting and key-aware comparison. For general text comparison without uploading, the Diff Checker works by paste only.
Supported File Formats
TextCompare accepts any plain-text file. Binary formats (Word .docx, PDF, images) are not supported — paste their text content manually instead.
Documents
- .txt — Plain text
- .md — Markdown
- .csv — Comma-separated
- .tsv — Tab-separated
- .log — Log files
Data & Config
- .json — JSON data
- .xml — XML markup
- .yaml / .yml — YAML
- .toml — TOML config
- .ini — INI config
- .env — Env variables
Web
- .html / .htm
- .css — Stylesheets
- .js — JavaScript
- .ts — TypeScript
- .jsx / .tsx — React
Backend & Systems
- .py — Python
- .rb — Ruby
- .java — Java
- .cs — C#
- .go — Go
- .rs — Rust
- .sh / .bash — Shell
- .sql — SQL
Frequently Asked Questions
Click the upload icon (arrow) in the top-right corner of either panel to browse for a file, or drag a file from your computer's file manager and drop it anywhere in the panel. Repeat for the second panel, then click Compare. You can also drag both files onto the page at the same time.
Any plain-text file format works: .txt, .md, .csv, .json, .xml, .yaml, .yml, .html, .css, .js, .ts, .py, .rb, .java, .cs, .go, .rs, .sh, .sql, .log, and more. Binary files like Word documents or PDFs cannot be compared directly — extract the text first (copy-paste from the document).
Yes. TextCompare reads files entirely in your browser using the browser's built-in File API. No file content is ever transmitted to a server. Everything happens locally in your browser's memory — your files never leave your device. This makes it safe for confidential documents, credentials files, and private data.