Skip to content
Plaintools

Text diff checker

Paste a before and after. The right-hand pane is the new text. We highlight line changes and, inside a changed line, word edits. Ignore whitespace if you only care about tokens. Copy a unified diff for a review tool.

0 added · 0 removed

Paste two versions to see a live diff.

Text diff checker example

A small function rewrite

Before: a greet() that concatenates strings. After: a template literal and a second call. The diff marks the return line as a word change and the extra call as an addition.

Text diff checker how-to

  1. Optionally prepare both strings: split on \n, trim each line, replace /\s+/g with a single space, rejoin with \n.
  2. Run npm `diff` `diffLines(left, right)` (Myers-style).
  3. If a removed change is immediately followed by an added change, treat them as a replace: zip lines; for paired lines run `diffWords`; leftover old lines are remove, leftover new lines are add.
  4. Otherwise emit add/remove/equal rows per line (split the chunk on newlines; a trailing newline on the chunk is dropped before split).
  5. Copy uses `createTwoFilesPatch` with filenames before/after and context 3. Colour is display-only.

Related tools

Dev

JWT decoder

Read a JWT header and payload, with human timestamps and an expired flag. The token stays in the tab.

Dev

Hash generator

Calculate SHA-256, SHA-384, SHA-512, and SHA-1 checksums for text or local files.

Text

Case converter

Convert text between lowercase, UPPERCASE, Title Case, Sentence case, camelCase, PascalCase, snake_case, and kebab-case.

Text

Readability checker

Calculate Flesch Reading Ease, Flesch-Kincaid Grade Level, Gunning Fog, and reading time estimates client-side.

People also use

Dev

Timestamp converter

Convert Unix epoch timestamps in seconds or milliseconds to ISO 8601, UTC, and local time.

Dev

CSV to JSON converter

Convert CSV records to a JSON array of objects with header mapping and type detection.

Dev

Subnet calculator

Calculate IPv4 network address, broadcast, usable range, subnet mask, and host capacity from CIDR.

Dev

CIDR calculator

Calculate IPv4 CIDR blocks, network address, broadcast address, netmask, usable hosts, and wildcard mask.

Text diff checker FAQ

What is a text diff checker?
A text diff checker compares two versions of text or code and highlights additions, deletions, and edits. This tool runs a Myers-style line diff plus word-level highlighting entirely in your browser—no account, no upload—so you can review snippets, configs, and copy changes privately.
Is my text uploaded?
No. The line and word diff run in this tab with the npm diff package. There is no upload and no API route for your text. Disconnect the network first if you need a stronger guarantee.
Is this git diff?
It is a Myers-style line diff (the npm diff package) plus a word diff on replaced lines. It is not a git index and does not read your disk.
What does ignore whitespace do?
Leading and trailing space on each line is trimmed, and internal runs of whitespace collapse to one space, then we diff. Indent-only noise drops out; a real token change still shows.
Can I diff whole files?
Paste the text. There is no file-upload API. Very large dumps will freeze the tab; this is for snippets and configs.
Does copy include the colours?
Copy result writes a unified patch (--- before / +++ after). Colour is only in the on-page view.
How do I produce the same diff without this page?
Optionally ignore whitespace: trim each line and collapse internal /\s+/ to one space. Then npm `diff`: diffLines(before, after). If a removed chunk is immediately followed by an added chunk, zip those lines and run diffWords on paired lines (leftover lines stay add/remove). Copy is createTwoFilesPatch("before", "after", …, { context: 3 }). This is not git.