Diff Checker

Compare two texts or code files side by side and highlight every added, removed, and modified line. Supports split and unified views, inline character-level highlights, whitespace/case-ignore options, and one-click diff copy.

diff compare text diff code diff file comparison line diff unified diff
Free Client-Side Private
Original (A)
Changed (B)
🔒 This tool runs entirely in your browser — your files are never uploaded to any server.

Diff Checker compares two pieces of text or code line by line and highlights every addition, deletion, and modification. Everything runs in your browser — no files are uploaded to any server.

Features

Feature Detail
Split view Original (A) and changed (B) shown side by side for easy visual comparison
Unified view A single column with + / - / ~ prefix markers, like a standard patch file
Inline character highlights Within modified lines, the exact characters added or removed are highlighted in green/red
Context mode Show only the changed lines with 3 lines of context on each side — hides identical sections
Full-file mode Show every line including unchanged ones
Ignore whitespace Treat lines that differ only in spaces/tabs as identical
Ignore case Treat uppercase and lowercase as the same when comparing
Swap Swap side A and B instantly to reverse the comparison direction
Stats bar Summary of added, removed, modified, and unchanged line counts
Copy diff Copies the plain-text unified diff to your clipboard with one click

How to Use

  1. Paste the original text or code into the Original (A) panel on the left.
  2. Paste the modified version into the Changed (B) panel on the right.
  3. Click Compare — differences appear highlighted below.
  4. Use Split for a side-by-side view or Unified for a top-to-bottom single-column view.
  5. Toggle Context to hide unchanged lines and focus on the diffs, or Full file to see everything.
  6. Enable Inline highlights to see character-level changes within modified lines.
  7. Click Copy diff to copy the result as a plain-text patch.

Colour Coding

Colour Meaning
Green Line added in B (not present in A)
Red Line removed in A (not present in B)
Orange Line present in both but modified
Default Unchanged line

Within modified lines (orange), inline character highlights show the exact characters that were removed (red strikethrough) or added (green background).

Split vs Unified View

Split View

Both texts are shown side by side in two columns with matching line numbers. Added lines appear only in the right column; deleted lines appear only in the left column; modified lines show both versions with character-level highlighting.

Unified View

Both texts are merged into a single scrollable column — lines removed from A are shown in red, lines added in B in green. This is the same format used by git diff and standard patch files.

Options

Ignore Whitespace

When enabled, lines that differ only in leading/trailing spaces or tab indentation are treated as equal. Useful for comparing code that has been reformatted.

Ignore Case

When enabled, uppercase and lowercase letters are treated as identical for matching purposes. The original casing is preserved in the display.

Inline Highlights

When enabled, modified lines show exactly which characters changed at the character level using a fast LCS algorithm. Disable for faster rendering on very large files.

Use Cases

  • Code review — compare two versions of a function or file to spot regressions
  • Document editing — find what changed between two drafts of a document
  • Configuration management — diff config files before and after a change
  • API response debugging — compare two JSON or XML responses
  • Database migration — compare SQL schema files between environments

Frequently Asked Questions

Is there a file size limit?

There is no enforced limit. The tool uses an LCS (Longest Common Subsequence) algorithm in the browser. For typical code files and documents (under a few thousand lines) comparison is near-instantaneous. Very large files with tens of thousands of lines may take a moment.

Does this tool upload my text to a server?

No. All comparison runs locally in your browser using JavaScript. Your text is never sent anywhere.

What is the difference between Split and Unified view?

Split view shows both texts side by side in two columns; unified view merges them into one column using + and - markers — the same format as git diff output.

What does "Ignore whitespace" do exactly?

It normalises each line by collapsing multiple spaces and tabs into a single space and trimming leading/trailing whitespace before comparing. Lines that are identical after normalisation are treated as equal, even if the raw indentation differs.

What are inline highlights?

When a line has been modified (not entirely added or removed), the tool runs a second character-level diff to pinpoint exactly which characters changed. Deleted characters are shown with a red background, added characters with a green background, within the line.

Can I compare code from two different programming languages?

Yes. The tool is language-agnostic and compares any plain text. Language-specific syntax highlighting is not applied, but the structural diff works correctly for any language.

How is "modified" (orange) line detected?

When a deleted line and an added line appear next to each other in the diff output, they are treated as a single modification of the same line rather than an independent delete and insert. This makes the diff easier to read and enables inline character highlighting.

Can I copy the result?

Yes. Click Copy diff in the stats bar to copy a plain-text version of the unified diff (lines prefixed with +, -, or two spaces for unchanged) to your clipboard.

Report an issue