DevTools Logo

Diff Checker

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

Diff Checker compares two text blocks one line at a time with a custom longest-common-subsequence algorithm. It splits both inputs at newline characters, aligns matching lines, and classifies each result row as added, removed, or unchanged. A changed line therefore appears as one removal followed by one addition rather than as a separate modified-line result.

The result can be viewed in aligned side-by-side columns or as a unified list, with green additions, red removals, original and modified line numbers, and counts for additions, removals, and unchanged rows. Copy and Download produce a plain-text diff using '+ ' for additions, '- ' for removals, and two spaces for unchanged lines.

Comparison is case-sensitive by default. Turning off Case sensitive lowercases lines only for matching, while Ignore whitespace trims leading and trailing whitespace before matching; it does not ignore spacing within a line. The inputs can also be swapped, and built-in code, configuration, and JSON pairs can be loaded for a quick comparison.

How to use

  1. Enter both text versions

    Paste the baseline into Original Text and the new version into Modified Text. The line-based result updates as either input changes.

  2. Choose matching options

    Keep Case sensitive on for exact casing, turn it off to compare lowercase-normalized lines, and enable Ignore whitespace when leading or trailing spaces should not count.

  3. Inspect the result

    Use Side by Side to align both versions or Unified to scan one stream. Read removals in red, additions in green, and the summary badge for change counts.

  4. Copy, download, or reverse the comparison

    Copy the marker-prefixed diff, download it as a text file, or Swap the inputs to view the change in the opposite direction.

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.

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

References & standards