Skip to content

Text Utilities

Diff Checker

Compare two blocks of text and highlight the changes.

diff Client-side

Diff result

0 additions · 0 deletions
 

Frequently Asked Questions & Guide

How to use this Diff Checker
  1. Paste the original text into the Original box on the left.
  2. Paste the modified text into the Modified box on the right.
  3. Choose a diff mode: character, word, line, or sentence. Line mode is the default and works best for most code.
  4. Optionally enable Ignore whitespace (treats runs of whitespace as equivalent) or Ignore case (case-insensitive comparison).
  5. The diff appears in the result panel below. Additions are highlighted in green; deletions in red.

This tool uses the jsdiff library, the most popular diff library in the JavaScript ecosystem. It implements the Myers diff algorithm (the same algorithm used by Git) and supports character, word, line, sentence, and JSON diffs. The output is rendered as color-coded inline text — additions in green, deletions in red, unchanged text in default color.

What is a Diff?

A diff (short for "difference") is a textual representation of the changes between two versions of a document. The most common diff formats are unified diff (used by git diff and diff -u) and inline diff (used by this tool). Diff algorithms find the longest common subsequence between two texts and emit the parts that were added or removed.

Diffs are essential to software development. Code review systems (GitHub Pull Requests, GitLab Merge Requests, Gerrit) display diffs so reviewers can see exactly what changed. Version control systems (Git, Mercurial, Subversion) store diffs as the basis for efficient storage. Documentation teams use diffs to track revisions to specifications. Lawyers use diffs to compare contract drafts. This tool lets you diff any two pieces of text without installing anything.

Which mode should I use?

For source code, use Line diff — it shows which lines were added or removed, which is what code review tools do. For prose (articles, documentation, emails), use Word diff or Sentence diff — line diffs on prose tend to mark entire paragraphs as changed when only a few words differ. For very short strings (single-line values, IDs), use Character diff to see exactly which characters changed.

How is this different from git diff?

Functionally, very similar. git diff uses the Myers algorithm, just like jsdiff. The differences are: (1) git operates on files in a repository, while this tool operates on pasted text; (2) git produces a unified diff format with + and - prefixes, while this tool produces a color-coded inline diff; (3) git can diff binary files, while this tool is text-only.

Does it work for very large inputs?

The Myers algorithm is O(N×M) in time and space where N and M are the input lengths. For inputs of a few thousand lines, it runs in well under a second. For inputs of tens of thousands of lines, you may notice a brief delay. For very large inputs (millions of lines), the browser may freeze — in those cases, use git diff locally.

Is my text sent to a server?

No. jsdiff runs entirely in your browser. Your text never leaves your device.