Made in / Donate

Text & code diff checker

Compare two versions of text or source code, or add more and every text is compared with each other. Differences are marked inside the boxes as you type. Changed lines sit side by side or in one column, and replaced lines highlight the exact words, or characters, that changed. Ignore whitespace or letter case when those differences do not matter, then copy or download a unified patch.

Up to 200,000 bytes and 5,000 lines per side

How the comparison works

Lines first
The shortest sequence of inserted and removed lines is found, so unchanged sections remain aligned.
Words or characters second
When a removed line is followed by an added line, their words and punctuation, or with Highlight set to Characters every single character, are compared for the smaller highlights.
Split or unified
Split puts the original and the changed text side by side; Unified shows one column, removed lines above the lines that replace them, like a patch.
Patch output
The same result is available as a unified diff with ---, +++ and @@ markers.
Options
Whitespace and case can be ignored for matching, and for the highlights inside changed lines, without altering the text shown in the result.

See what changed, not just that it changed

Paste an original version on the left and a changed version on the right. The first comparison works line by line: unchanged lines stay together, removed lines are red, and added lines are green. When a removed line and an added line occupy the same changed block, the checker compares them character by character too (or word by word, if you choose). The darker marks show the smallest pieces that were replaced.

This two-stage view is useful for prose and code. A paragraph with one corrected number remains recognisable as the same paragraph, while the corrected number is highlighted. A function call with one new argument shows the old and new line together instead of presenting two unrelated blocks.

Why use it

Side-by-side lines

Original and changed versions remain aligned with separate line numbers.

Word-level highlights

Replaced lines mark the exact words, spaces and punctuation that changed.

Whitespace option

Ignore indentation and spacing while keeping the original text visible.

Case option

Compare without treating capitalization alone as a change.

Unified patch

Copy or download a standard-style patch containing the same comparison.

Shareable comparison

Copy a link carrying both inputs and the selected matching options.

Comparison options

Ignore whitespace collapses runs of spaces, tabs and other whitespace for line matching and ignores whitespace at either end. The original characters are still displayed in the result; they simply do not make a line count as changed, and inside a changed line a change that is only whitespace isn’t marked. This is helpful after an automatic formatter has changed indentation around the edit you care about.

Ignore letter case compares each line case-insensitively. It is useful for lists, configuration values and prose where capitalization is not significant. The option uses Unicode-aware lowercasing, so it is not limited to ASCII letters. Both options can be used together.

The selected options are part of the query string with the two inputs. Copy link therefore opens the same comparison with the same matching rules. Large inputs can produce a long URL, so a patch is usually the more convenient file to attach to a ticket or send for review.

Unified patch output

The downloaded changes.patch is a unified diff. It starts with --- before.txt and +++ after.txt, followed by an @@ range header. Context lines begin with a space, removed lines with a minus sign, and added lines with a plus sign. The tool emits one complete hunk so the patch keeps the full context of the pasted inputs.

A patch is plain text. It can be attached to an issue, kept with a change request, or read by tools that understand unified diffs. Copy patch puts the same output on the clipboard. When whitespace or case is ignored, differences suppressed by that option are also absent from the patch, while the lines that remain are written with their original spelling and spacing.

Who it’s for

For code review

Inspect a compact change without setting up a repository or opening an editor.

For editors

Find corrected wording, punctuation and numbers between two drafts.

For operations teams

Compare configuration, logs and generated output with whitespace controls.

For support teams

Turn before-and-after examples into a patch that can be attached to a ticket.

How the matching works

The line comparison uses Myers’ shortest-edit algorithm. It looks for a path through the two sequences that uses the fewest insertions and deletions, which is the model behind familiar source-control diffs. Long unchanged runs are cheap to follow. Completely unrelated inputs require more work, so the tool places explicit limits on input size, line count and comparison work rather than allowing one request to consume unbounded memory or CPU.

With Highlight set to Words, changed-line highlighting tokenizes letters and numbers, whitespace, and punctuation. The same shortest-edit search then runs over those tokens. This keeps punctuation changes visible: replacing === with ==, adding a comma, or changing a path separator does not disappear inside a word-only comparison.

A word is the smallest piece in that mode, so in 2123020203359 against 1123020203359 the whole number is marked. Characters, the default, marks only the first digit: the comparison runs character by character, after setting aside what the two lines share at the start and the end. View switches between Split, the two versions side by side, and Unified, one column with each removed line above the line that replaces it, as in a patch. Both are display choices: the counts and the patch stay the same, and Copy link keeps them.

Differences are also marked inside the boxes while you type, before the full comparison below has updated: changed lines get a tint, and the characters that differ a stronger mark, red in the original and green in the changed text. That part runs in your browser on every keystroke, with the same rules (lines first, then characters, and the ignore options).

Use + Add text for more versions, up to ten. Every text is then compared with each other: original with changed, original with text 3, changed with text 3, and so on. Inside the boxes, a character is marked when it differs from any of the other texts. Below, a summary says which texts match, with a link to each pair’s comparison, and every pair has its own patch to copy or download. With more than three pairs, each pair is folded until you open it. Empty boxes are left out, and with only two texts it is the usual two-way comparison.

Tips for a useful diff

  • Compare like with like. Format both JSON documents or both code samples first when formatting itself is not the subject of the review.
  • Keep related lines near their old position. Moving a large block is represented as removal plus insertion, as it is in an ordinary unified diff.
  • Use ignore-whitespace for indentation churn, but turn it off when spacing is syntactically meaningful.
  • Use the patch for durable exchange. A copied comparison link contains the pasted values and is best suited to compact examples.
  • Split very large or completely unrelated files into logical sections when the processing-limit message appears.

Frequently asked questions

What kinds of text can I compare?

Plain text, source code, configuration, logs, JSON, CSV and similar text all work. The comparison treats the input as lines and does not need to recognize a programming language.

Does ignoring whitespace change my text?

No. Whitespace is normalized only for deciding whether two lines match. The original lines remain in the result and patch whenever another change makes them part of the diff.

Why does a moved block appear twice?

A unified line diff represents a move as lines removed from the old position and inserted at the new position. It does not infer that the two blocks have the same intent.

Is the downloaded file a valid patch?

It uses unified-diff markers and prefixes and contains the full inputs as one hunk. Patch programs can read that structure, although applying an unnamed pasted fragment may require supplying the intended file path.

Why is there a processing limit?

Finding a shortest edit path is fast for ordinary revisions but becomes expensive when thousands of lines have almost nothing in common. The byte, line and work limits keep requests bounded; split unrelated large inputs into sections.

How do I compare without JavaScript?

The form submits with a normal GET request and the server renders the complete result. JavaScript only adds clipboard shortcuts and Ctrl/Cmd+Enter submission.

Read the full story: How a Text Diff Finds One Small Change in a Large File (9 min read)

More developer tools

  • JSON / CSV / PHP Converter: Convert between JSON, XML, CSV, YAML, query strings and PHP arrays, var_dump(), print_r() and serialize() in any direction.
  • What’s My IP, VPN Check & Browser Info: What every website learns about you: your IP address, whether you look like you’re on a VPN, proxy or Tor and whether your real IP leaks past it, plus your browser, system, screen, language, time zone and headers.
  • Time-Saving Chrome Extensions: Free Chrome extensions that turn daily chores into one click: clear out every duplicate tab, turn bare Apache and nginx directory listings into a file browser you drive from the keyboard, and start a Google Meet with its link already copied.
  • Paste Notepad & Converter: Strip Formatting, View HTML, Convert JSON: A blank page for text you need for a minute: paste with formatting and pictures, or strip it to plain text in one click.
  • Cron Expression Explainer & Next Run Times: Turn a crontab line into plain English and list its next runs in the server’s time zone and yours, with the runs daylight saving skips or doubles flagged.