Converters
Calculators
Other Tools
Browse tools
Checkers

Text diff checker

Compare two blocks of text line by line — added, removed, and unchanged lines are marked clearly, side by side.

Never leaves your device No signup Free forever Not stored, not logged

Original

Changed

Paste text in both boxes and press Compare to see the line-by-line diff.

More checkers

Related tools you might need next

All checkers

How it works

Two steps, no account

1

Paste both versions

Original text on the left, changed text on the right — plain text, code, config files, anything line-based.

2

Press Compare

Removed lines are marked with -, added lines with +, and unchanged lines are shown as-is, so you can see exactly what moved.

FAQ

Common questions

Does this compare word by word or line by line?
Line by line. If a single line changes even slightly, that whole line is shown as one removed line and one added line rather than highlighting the specific characters that differ within it.
How does the comparison actually work?
It finds the longest common subsequence (LCS) of matching lines between the two texts, then reports every line that isn't part of that shared sequence as removed (from the original) or added (in the changed version) — the same core idea most diff tools use.
Does line order or whitespace matter?
Yes to both. Lines are compared exactly as typed, so trailing spaces or reordered lines will show as changes even if the visible words are identical.
Is either text sent anywhere?
No. The comparison runs entirely in your browser with plain JavaScript — nothing is uploaded, logged, or stored.
ad slot · bottom of content 336×280 / responsive
Related

People who used this also used

Text Diff Checker

Our Text Diff Checker compares two blocks of text and shows exactly what changed, line by line. Paste an original and a changed version, press Compare, and see removed lines, added lines, and unchanged lines laid out clearly — no upload, no install.

How to Use the Text Diff Checker

1. Paste Both Versions

  • Paste the original text into the left box
  • Paste the changed version into the right box
  • Works with plain text, code, config files, or any line-based content

2. Press Compare

  • The comparison runs instantly in your browser
  • A summary shows counts of unchanged, removed, and added lines
  • The full diff renders below, line by line

3. Read the Result

  • Unchanged lines are shown as-is, with no marker
  • Removed lines (only in the original) are marked with - and a muted red background
  • Added lines (only in the changed version) are marked with + and a muted green background

Key Features

Line-Level Diffing

  • Compares whole lines against each other, not individual words or characters
  • A single edited word still shows as one removed line and one added line — the clearest way to see line-based changes

LCS-Based Algorithm

  • Uses a longest common subsequence (LCS) approach, the same underlying idea behind most diff tools
  • Finds the largest set of lines that appear in both texts in the same order, then reports everything else as added or removed

Clear Visual Markers

  • Removed and added lines use distinct colors and -/+ prefixes, matching the convention used by most version-control diff output
  • A summary count at the top gives an immediate sense of how different the two texts are

Exact Matching

  • Lines are compared exactly, including whitespace and case
  • This avoids false "no difference" results when subtle formatting actually changed

Use Cases

1. Code Review

  • Comparing two versions of a config file, snippet, or script before merging
  • Spotting an unintended change buried in a larger paste

2. Content Editing

  • Comparing draft revisions of an article or document
  • Confirming exactly what an editor changed, line by line

3. Data Verification

  • Comparing two exports of the same data to confirm they match
  • Checking whether a template or boilerplate file drifted from its source

Technical Features

  • Vanilla JavaScript: No external diff library — a straightforward LCS table computed directly in the browser
  • Real-Time Rendering: Results appear immediately after pressing Compare
  • Line-Based Splitting: Text is split on newlines, so the diff respects the actual line structure of your input
  • No Size Optimization Tricks: The O(n·m) LCS approach is simple and correct for typical text sizes — pastes, snippets, and short-to-medium documents

Why Use Our Text Diff Checker

1. No Signup, No Upload

  • Both text boxes stay in your browser tab
  • Nothing is sent to a server to compute the diff

2. Readable Output

  • Clear color coding and +/- markers make changes easy to scan at a glance
  • A summary count avoids having to manually tally additions and removals

3. Privacy Focused

  • Client-side processing only
  • No data storage, no logging — useful when comparing text you'd rather not paste into a random web form

Understanding Text Diffing

What Is a Diff?

A diff (short for "difference") is a way of describing how two pieces of text relate to each other — which parts they share and which parts differ — usually expressed as a sequence of unchanged, added, and removed lines.

How LCS-Based Diffing Works

  1. Build a table: For every pair of positions in the two texts, compute the length of the longest common subsequence of lines from that point onward
  2. Walk it backwards: Starting from the beginning, follow the table to decide, line by line, whether it's shared (unchanged), only in the original (removed), or only in the changed version (added)
  3. Emit the result: The walk produces an ordered list of unchanged/removed/added lines that reconstructs both original and changed texts

Line Diff vs. Word Diff

A line-level diff (what this tool does) treats each line as a single unit — good for spotting which lines changed and preserving surrounding context. A word-level diff would highlight the specific words that changed within a line, which is more granular but noisier for large edits. Line diffing is the standard choice for code, config files, and structured text.

Best Practices

  1. Normalize first if formatting doesn't matter: Trim trailing whitespace or normalize line endings before comparing if you only care about content, not formatting
  2. Read removed/added pairs together: A removed line immediately followed by an added line usually represents one edited line, not two unrelated changes
  3. Use it before merging, not after: Catching an unintended change before it ships is far cheaper than debugging it later

Remember: this tool compares text exactly as typed — including whitespace and line breaks — so a "different" result can sometimes mean only the formatting changed, not the visible content.