100% Private & Secure

Text Diff
Compare Two Texts Side by Side

Paste or upload two texts and instantly see every difference highlighted — line by line and character by character. Everything runs in your browser, nothing is uploaded.

Side-by-side comparisonCharacter-level diffsUpload or pasteNo upload required

 

 

Overview

What Is a Text Diff Tool?

A text diff tool compares two pieces of text and highlights every difference between them. It works line by line, marking lines that were added, removed, or changed. When a line has been modified rather than fully replaced, character-level highlighting pinpoints the exact characters that differ — so you can spot a single typo in a long line without reading every character.

Our Text Diff tool uses a Longest Common Subsequence (LCS) algorithm to produce accurate, minimal diffs. Paste text directly, upload files, toggle whitespace and case sensitivity options, and view results in three modes: side by side, unified, or inline.

The side-by-side view places the original and modified texts in two aligned columns with line numbers, making it easy to scan through a document and see exactly where changes occur. The unified view shows a single column with minus and plus prefixes, just like a git diff or patch file. The inline view merges both texts with strikethrough for removals and highlights for additions.

Everything runs entirely in your browser — no data is sent to any server. The tool is ideal for comparing code, configuration files, contracts, essays, API responses, and any other text. Close the tab and nothing remains.

Features

Discover Features

Line-level and character-level diffs, multiple view modes, file upload, comparison options, and full privacy — all on your device

Side-by-Side Comparison

View the original and modified texts in two aligned columns with line numbers. Removed lines are highlighted in red on the left, added lines in green on the right — making changes instantly visible.

Character-Level Diffs

When a line is changed rather than simply added or removed, the tool highlights the exact characters that differ within the line. Quickly spot a single typo in a long line without reading every character.

Multiple View Modes

Choose from three display modes: Side-by-Side for parallel comparison, Unified for a single-column patch-style view, or Inline for merged text with strikethrough removals and highlighted additions.

File Upload Support

Upload .txt, .md, .json, .xml, .csv, .html, .css, .js, and many more file types directly into either input. No size limits beyond your browser memory — compare entire configuration files or source code.

Comparison Options

Toggle ignore-whitespace to skip indentation and trailing-space differences. Enable case-insensitive mode to treat uppercase and lowercase as equal. Focus on the changes that actually matter.

100% Private & Secure

All diffing runs entirely in your browser using JavaScript. Nothing is sent to any server. Your texts never leave your device — close the tab and nothing remains. Perfect for comparing sensitive documents.

How to Use

Four steps: paste texts, set options, compare, and review the highlighted differences

01
01

Paste or upload texts

Enter the original text in the left textarea and the modified text in the right textarea. You can also click 'Upload file' to load content from a file.

02
02

Set comparison options

Toggle 'Ignore whitespace' to skip indentation differences or 'Case insensitive' to treat upper/lowercase equally. Both options are optional.

03
03

Click Compare

Hit the Compare button. The tool computes line-level and character-level diffs using the LCS algorithm and displays the results below.

04
04

Review and copy

Switch between Side-by-Side, Unified, and Inline views. Use the 'Copy Diff' button to copy the unified diff to your clipboard for sharing or patching.

Use Cases

Common scenarios where comparing two texts saves time and prevents mistakes

Code Review

Compare two versions of a source file to see exactly what changed between commits, branches, or pull requests — without leaving your browser.

Document Proofreading

Spot edits, corrections, and rewrites in contracts, essays, or articles by comparing the draft and final versions side by side.

Configuration Debugging

Compare working and broken config files (JSON, YAML, TOML, .env) to pinpoint the exact line or value that introduced a bug.

Translation Comparison

Place the original and translated text side by side to verify that every paragraph and sentence has been translated without accidental omissions.

Database Migration Scripts

Diff two versions of SQL migration scripts to ensure only intended schema changes are applied before running in production.

API Response Comparison

Compare JSON or XML responses from different API endpoints, environments, or time periods to identify data discrepancies and regressions.

Compare Plans

Free vs Paid — Text Diff

Get started free, upgrade when you need more power.

Feature
Free
Paid
Daily usage
5 uses/day
Unlimited
File size limit
10 MB
Up to 500 MB
All core features
No software installation
Works on any device
Files stay on your device
Batch processing
Priority support
Upgrade to Full Version

Unlock the Full Power of Text Diff

Remove daily limits, process larger files up to 500 MB, enable batch processing, and get priority support.

Developer Tools includes:

  • 13 developer & utility tools
  • Unlimited daily uses
  • No file size limits
  • All output formats

Also available in the All Tools Bundle

FAQ

FAQ

Frequently asked questions about the Text Diff tool

Q1. What diff algorithm does this tool use?
The tool uses a Longest Common Subsequence (LCS) algorithm. It splits both texts into lines, computes the LCS of the two line arrays, then walks through both to mark lines as equal, added, or removed. For changed lines (consecutive removal + addition), it also runs a character-level LCS to highlight the exact characters that differ.
Q2. Is my data safe?
Yes. All processing happens entirely in your browser using JavaScript. Nothing is sent to any server. Your texts never leave your device — close the tab and nothing remains.
Q3. What file types can I upload?
You can upload any plain-text file: .txt, .md, .json, .xml, .csv, .html, .css, .js, .ts, .py, .java, .sql, .yaml, .toml, .log, and many more. The tool reads the file as text, so binary files (images, PDFs) are not supported.
Q4. What does 'Ignore whitespace' do?
When enabled, the tool normalizes all whitespace sequences (spaces, tabs, newlines) to a single space and trims leading/trailing whitespace before comparing. This lets you focus on content changes and ignore indentation or formatting differences.
Q5. What does 'Case insensitive' do?
When enabled, the tool converts both texts to lowercase before comparing. Lines that differ only in capitalization are treated as equal. The original casing is preserved in the diff display.
Q6. What is the difference between the three view modes?
Side-by-Side shows the original and modified texts in two aligned columns. Unified shows a single column with - and + prefixes like a patch file. Inline merges both texts into one view with strikethrough for removals and highlights for additions.
Q7. How is the similarity percentage calculated?
Similarity is calculated as (unchanged lines / max(original lines, modified lines)) × 100. A score of 100% means the texts are identical. A score near 0% means almost every line differs.
Q8. Can I compare very large files?
Yes, but performance depends on your browser and device. The LCS algorithm has O(m×n) time complexity, so comparing two files with thousands of lines each may take a moment. For extremely large files (10,000+ lines), consider splitting them into smaller sections.
More tools

Related Tools

Compare texts, then try these other utility tools