By Tim King · Updated
Text Diff
Added and Removed Lines, Word-Level Highlights Inside Edited Lines
OneTask is free, with no sign-up, and built by one person.
If this tool saved you time, a coffee helps keep new ones coming.
How the Text Diff works
This text diff tool highlights every change between two versions. Paste one version on the left and the other on the right to see exactly what changed. Added and removed lines are marked and colour-coded the way a code review shows them, and lines that were edited rather than replaced get the changed words highlighted inside them.
Text diff: why reading twice does not work
Comparing two versions of anything by eye is unreliable work. A moved paragraph, a changed digit in a config value, a swapped word in a contract clause — these are precisely the differences that matter and precisely the ones reading twice will not catch. A diff finds them mechanically.
Compare two texts line by line
This tool compares line by line, which is the same unit git, code review tools and most editors use. It finds the longest sequence of lines the two versions have in common and treats everything outside that sequence as changed, which is what makes the output track your intent: insert a paragraph in the middle of a document and you get one block of added lines, not a claim that every line after the insertion point moved. Lines present only in the original are marked as removed, lines present only in the changed version are marked as added, and unchanged lines are shown for context with their line numbers on both sides.
Word-level highlighting inside a changed line
Line-level output alone is blunt, though. When you fix a typo, a plain line diff tells you the whole line was deleted and a whole new line added, leaving you to spot the one character that actually changed. So when a removal and an addition line up as the same line edited, this tool runs a second comparison inside them, at word level, and highlights only the words that differ. You get the structure of a line diff with the precision of a word diff, which is the combination you want for prose as much as for code.
Ignore case and ignore whitespace
Two options change what counts as a difference. Ignore case treats Error and error as the
same line, useful when comparing output from tools that disagree about capitalisation. Ignore
whitespace strips spaces and tabs before comparing, so a reindented block, a line rewrapped at a
different width, or a file that picked up trailing spaces stops drowning the real changes in
noise. Both affect matching only — the text is always displayed exactly as you pasted it.
Swap sides and copy diff
Swap sides flips the two inputs, which is the quickest way to check whether you loaded them in the order you meant. Copy diff puts the whole comparison on your clipboard in the familiar unified format, with a leading space, plus or minus on each line, so it can be pasted into a ticket or a chat message and read by anyone.
Diff checker online, without the upload
Everything runs in your browser as you type. There is no upload and no request to any server, which matters because the things people most often need to diff — contract drafts, config files with hostnames in them, log excerpts, unreleased copy — are the things least suited to being pasted into an unknown web service. Very large inputs are the one limit: past a few thousand differing lines the comparison is reported as too large rather than allowed to freeze the tab.
How to read the output
| Marker | Colour | Meaning |
|---|---|---|
- |
Red | Line exists only in the original |
+ |
Green | Line exists only in the changed version |
(space) |
None | Unchanged, shown for context with both line numbers |
| Highlighted word | Darker red or green | The words that differ inside a paired removal and addition |
| Too large | — | More than a few thousand differing lines; split the input |
Find differences between documents: which option to use
| Situation | Setting |
|---|---|
| Config file reindented by an editor | Ignore whitespace |
| Log output from two tools, one shouting in capitals | Ignore case |
| Contract draft rewrapped at a different column | Ignore whitespace |
| Code snippets where indentation is the change | Leave both off |
| Pasted in the wrong order | Swap sides |
FAQ
What do the colours and the plus and minus signs mean?
A minus and a red tint mark a line that exists in the original but not in the changed version. A plus and a green tint mark a line that exists only in the changed version. Unmarked lines are identical in both and are shown so you can see where the changes sit.
Why are some words highlighted inside a changed line?
Because that line was edited rather than replaced outright. When a removed line and an added line correspond, the tool compares them word by word and highlights only the words that actually differ, so a one-character fix does not look like a whole rewritten line.
Can it ignore indentation and formatting changes?
Yes. Set whitespace to Ignore and spaces and tabs are stripped before lines are compared, so reindenting a block or rewrapping a paragraph no longer registers as a change. The lines are still displayed exactly as you pasted them, with the original spacing intact.
Does it work for code as well as prose?
Yes, and the output follows the same conventions as a code review: line numbers for both sides, plus and minus markers, and a unified-format copy that pastes cleanly into a pull request or an issue. Nothing about it is specific to a language, so it works on config, CSV, logs or plain text.
How do I compare two code snippets?
Paste the original on the left and the new version on the right. Leave ignore whitespace off if indentation is part of what you are checking, as in Python or YAML, and turn it on when an editor has reformatted the file and you only want the logical changes.
Can I compare two Word documents or PDFs?
Not directly, but the text can be. Select all in each document, copy, and paste into the two panes; formatting is dropped and the words are compared. Turn ignore whitespace on, because copied documents pick up different line wrapping and stray spaces that are not real changes.
See also: all Writing & Editing tools, Lists & Lines, Markdown & HTML, Ciphers & Alphabets.
Related tools
Markdown Editor
Write markdown with a live preview; open, save and autosave.
Character Counter
Characters against SMS, meta and social post limits.
Bibliography Generator
A sorted reference list in APA, MLA, Harvard or Chicago from many sources.
Headline Capitaliser
Capitalise headlines in AP, APA or Chicago style.
Keyword Density Checker
Word and phrase frequency with density percentages.