Supports 20+ File Formats — No Upload to Server

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.

0 lines
0 lines
Diff mode

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