Text Diff Checker - Compare Two Texts & See Changes Online

Paste two texts and instantly see every added and removed line highlighted. Free browser-based text diff checker — nothing uploaded, no sign-up needed.

Tool options

Layout

Compare options

Summary

+6 added5 removed
Original
Changed
Result+65
1{
2 "name": "checkout-api",
3 "version": "1.8.1",
4 "replicas": 2,
5 "features": {
6 "retry": false,
7 "tracing": true
8 },
9 "owners": ["platform-team"]
10}
1{
2 "name": "checkout-api",
3+ "version": "1.8.2",
4+ "replicas": 3,
5 "features": {
6+ "retry": true,
7+ "tracing": true,
8+ "metrics": true
9 },
10+ "owners": ["platform-team", "sre"]
11}

Spot every change between two texts in seconds

Paste your original text on the left and your updated version on the right. The text diff checker highlights exactly what was added, removed, or changed — line by line — so you never have to hunt for differences by eye again.

Your text stays entirely in your browser. Nothing is sent to any server, so you can safely compare passwords, private configs, or confidential documents.

How to use the text diff checker

  1. Paste your original text into the left panel.
  2. Paste the updated or second version into the right panel.
  3. The tool instantly highlights added lines in green and removed lines in red.
  4. Scroll through the results to review every change. Copy or note whatever you need.

Worked example – comparing two config files

Say you have two versions of a simple config file and want to see what changed between them.

Version A (original):

host: localhost
port: 3000
debug: false
log_level: warn

Version B (updated):

host: localhost
port: 8080
debug: true
log_level: info
timeout: 30

What the diff checker shows:

  • Removed: port: 3000
  • Added: port: 8080
  • Removed: debug: false
  • Added: debug: true
  • Removed: log_level: warn
  • Added: log_level: info
  • Added: timeout: 30

Three lines changed and one new line appeared. You'd have stared at that file for a while catching all of that manually — the diff tool finds it instantly.

How to compare text programmatically

If you need to run a text comparison in code rather than a browser, here are minimal working examples in two popular languages.

Python — using the built-in difflib module:

import difflib

original = ['host: localhost
', 'port: 3000
', 'debug: false
']
updated  = ['host: localhost
', 'port: 8080
', 'debug: true
']

diff = difflib.unified_diff(original, updated, fromfile='v1', tofile='v2')
print(''.join(diff))

This prints a unified diff — the same format used by Git — with - for removals and + for additions.

JavaScript (Node.js) — using the popular jsdiff library:

const Diff = require('diff');

const v1 = 'port: 3000
debug: false';
const v2 = 'port: 8080
debug: true';

const changes = Diff.diffLines(v1, v2);
changes.forEach(part => {
  const prefix = part.added ? '+' : part.removed ? '-' : ' ';
  process.stdout.write(prefix + part.value);
});

Install with npm install diff before running.

How the diff algorithm works

Under the hood, this tool uses the longest common subsequence (LCS) algorithm — the same foundation as the Unix diff command and Git. It finds the longest set of lines shared between both texts, then marks everything else as added or removed.

The result is a line-by-line comparison (sometimes called a line diff or side-by-side diff). Each line is treated as one unit, so a single character change in a long line shows the entire line as changed. The GNU diffutils manual is the canonical reference if you want to go deeper on how these algorithms work.

When to use a text diff checker — and when not to

Good fit ✅Not the right tool ❌
Comparing two drafts of a documentComparing binary files (images, PDFs, executables)
Spotting changes in config files (.yaml, .env, .json)Finding differences inside a single long line (use a character-level diff tool instead)
Reviewing code before committing without GitMerging changes from three or more versions (use a 3-way merge tool)
Checking if two copied texts are actually identicalComparing very large files (> a few MB) — paste limits may apply

Other text tools you might find useful

Quick reference — what the colors mean:
■ Green / + — line exists only in the new version (added)
■ Red / − — line exists only in the original version (removed)
■ Grey / space — line is unchanged in both versions

Paste your two texts above and the differences appear instantly — no sign-up, no upload, no waiting.

Frequently asked questions

Is my text uploaded or stored anywhere?+
No. The entire comparison runs inside your browser using JavaScript. Your text never leaves your device, so it's safe to compare passwords, private configs, or confidential documents.
What's the difference between a 'diff' and a 'compare'?+
They mean the same thing in practice. 'Diff' comes from the Unix diff command and is the term most developers use. 'Compare text' or 'text comparison' are the same action described in everyday language.
How do I compare two files in VS Code without a separate tool?+
Open the Command Palette (Ctrl+Shift+P on Windows/Linux, Cmd+Shift+P on Mac), type 'Compare Active File With', then choose any file. VS Code shows a side-by-side diff view built in. For quick online checks without VS Code, this browser tool is faster.
How do I diff two strings in Python?+
Python's built-in difflib module handles this with no extra install. Use difflib.unified_diff() for line-by-line output or difflib.SequenceMatcher() for a similarity ratio. See the worked example above for copy-pasteable code.
Can I compare two large blocks of text or files?+
Yes, up to several thousand lines with no trouble. Very large pastes (think tens of thousands of lines) may slow down the browser rendering slightly, but the comparison itself will still complete. For very large files, a terminal command like diff file1.txt file2.txt is faster.
Does this tool do a word-level or character-level diff?+
The default view is line-by-line: a line counts as changed if anything in it differs. If a single character changed inside a long line, the whole line shows as removed and re-added. For character-level highlighting within a line, you'd need a dedicated inline diff tool.
Is this tool free? Do I need to create an account?+
Completely free, no account needed. Open the page, paste your texts, and you're done.
What file types work with a text diff checker?+
Any plain-text format: .txt, .md, .yaml, .json, .env, .html, .css, .js, .py, .sql — paste the contents and it works. Binary formats like images, PDFs, or Word .docx files won't give meaningful results because their raw bytes aren't human-readable text.