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.
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.
Related: JWT decoder, JSON to CSV converter, YAML to JSON converter, Case converter, Readability checker
FAQ
- 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.