DevTools Logo

Diff Checker

Diff Checker: Compare Text Online

Compare two text blocks and highlight differences side-by-side

Examples

Replace one line and append another

Input
Original:
alpha
beta
gamma

Modified:
alpha
beta changed
gamma
delta
Output
  alpha
- beta
+ beta changed
  gamma
+ delta

The line replacement is represented as a removal and an addition; the final line is a separate addition.

Ignore edge whitespace and case

Input
Original:
Name: Ada  
Role: Engineer

Modified:
name: ada
Role: Engineer
Output
  name: ada
  Role: Engineer

With Ignore whitespace enabled and Case sensitive disabled, both lines match; unchanged rows use the modified text in the copied diff.

About this tool

This tool compares two texts line by line and reports what changed: lines only in the original are removed, lines only in the modified text are added, and rewritten pairs show as modified. A longest-common-subsequence pass aligns the versions like a version-control diff, computed entirely in your browser.

Two views cover both habits: Side by Side sets the texts in separate numbered columns, while the unified view stacks changes in one column behind +, - and ~ markers like a git patch. Inside modified line pairs the exact differing words are highlighted, so a one-word edit stands out.

Exports fit the next step: unified patch text, JSON with one record per line, or a colour-coded HTML table — each copyable or downloadable, plus a share link packing both texts into the URL. To turn a diff into a git patch file, continue with the Code Diff Patch Generator.

How to use this tool

  1. Paste both versions

    Put the original text in the first field and the modified one in the second; the diff updates as you type.

  2. Tune the comparison

    Switch on Ignore whitespace or turn off case sensitivity when formatting changes are not real edits.

  3. Review the changes

    Flip between Side by Side and Unified views, and enable word wrap for long lines.

  4. Export or share

    Copy or download the result as unified text, JSON or HTML, or create a share link carrying both texts.

Use cases

Reviewing configuration edits

Spot changed values and newly added settings between two versions of a line-oriented configuration file.

Comparing generated text

Check whether a template, report, or code generator changed its output between runs.

Verifying copy revisions

Identify added, removed, and replaced lines in documentation, release notes, or other prose.

Preparing a shareable text diff

Copy or download a compact marker-prefixed result for a review comment or debugging record.

Comparison options and outputs

OptionWhat it does
Ignore whitespaceTrims each line before comparing, so indentation stops marking lines as edited
Case sensitiveTurn off to treat Name and name as identical
Unified / JSON / HTML exportPatch-style text, one JSON record per line, or a colour-coded table

Common mistakes

Mistake:Reviewing a noisy diff caused only by trailing spaces.

Fix:Enable Ignore whitespace to trim leading and trailing whitespace during matching. Remember that spacing inside a line is still compared.

Mistake:Comparing CRLF text with LF text and interpreting carriage-return differences as content changes.

Fix:Normalize line endings before comparison, or enable Ignore whitespace so a trailing carriage return is removed by trim during matching.

Mistake:Expecting a word-level highlight inside a changed sentence.

Fix:This tool is line-based only. A changed line is shown as a removed line plus an added line; use a word-diff tool when token-level changes are required.

Mistake:Turning off case sensitivity without considering whether capitalization is meaningful.

Fix:Leave Case sensitive enabled for source code, identifiers, and case-sensitive data. Disable it only when differently cased lines should be treated as equal.

Frequently asked questions

Can I compare two JSON or code files?

Yes. Input is treated as plain text lines, so JSON, YAML, configs and source code all work. The tool does not parse syntax, so formatting a JSON file first gives cleaner results when only the data changed.

Why does the diff show lines that look identical?

Usually invisible characters: trailing spaces, tabs versus spaces, or Windows CRLF endings against Unix LF. Enable Ignore whitespace to skip spacing differences; line endings stay part of the line, so a CRLF/LF mismatch still marks it.

Is there a size limit?

No hard limit is enforced, but comparison runs locally and its cost grows with the product of the two line counts. A few hundred lines compare instantly; many thousands get slower.

Is my text uploaded?

No — the diff is computed in browser JavaScript. The only output that leaves the page is a share link you explicitly create, which encodes both texts in its query string.

References & standards