Text Diff Checker — Compare Two Texts or Code Snippets Online
FreeCompare two texts side by side with line-by-line diff highlighting. Changed, added, and removed lines clearly marked. Free, browser-based, instant.
What's next
Settings guide
Diff mode:
- ·Line-by-line — Changes shown as full added/removed lines with line numbers. Best for code, configs, and structured text.
- ·Word-by-word (inline) — Changes highlighted at the word level within each line. Better for prose, documentation, and text with small inline edits.
Display options:
- ·Show context lines — Show N unchanged lines above and below each changed block for context. 3 lines is the Git default.
- ·Ignore whitespace — Treats runs of whitespace as equivalent. Useful when indentation changed but content did not.
- ·Ignore case — Case differences are not flagged as changes.
Format comparison
Text diff vs Git diff: Git diff produces unified diff format (+ and - line markers with @@ hunk headers), designed for patch files and version control. The online diff is designed for visual inspection — colour-coded, human-readable, without the patch file syntax. Use Git diff for commits; use the online diff for quick visual comparison when you do not have Git context.
Word-level vs line-level diff: Line-level diff shows which lines changed but not where in the line. Word-level diff shows the exact characters that changed within each line. For single-character changes in a long line (a changed flag, a different value), word-level is significantly more useful.
How it works
Tokenise
Both texts are split into lines (line mode) or words (word mode). Whitespace normalisation and case folding are applied if the corresponding options are enabled.
Compute shortest edit sequence
The Myers diff algorithm finds the minimum number of additions and deletions needed to transform text A into text B. This gives the most minimal, meaningful diff — not just any sequence of edits.
Mark changes
Lines or words are marked as: unchanged (shown in context), added (in text B but not text A — green), or removed (in text A but not text B — red).
Display with line numbers
Both texts are displayed side by side or in unified format with original and new line numbers. Changed blocks are grouped with unchanged context lines above and below.
About this format
Paste two versions of any text — config files, API responses, code snippets, documentation drafts — and see exactly what changed: added lines in green, removed lines in red, unchanged context in neutral. The diff uses the standard Myers algorithm, the same one used by Git, to produce the shortest edit sequence between two texts.
Common uses: comparing two API responses to spot what changed between deploys, reviewing a config file before and after an edit, diffing JSON payloads when debugging an integration, and comparing two versions of a script or document.