Text Diff
Paste two versions of a text and see exactly which lines changed.
Output
Paste or type above to see the result here.
Your files stay on your device
This tool runs entirely in your browser. What you paste is processed on your device and is never sent to a server, so it is safe to use with tokens, keys and unpublished text.
How it works
- Paste the original version into the main box (A).
- Paste the changed version into the second box (B) below it.
- Press Compare. The output is a unified diff: lines starting with - exist only in A, lines starting with + exist only in B, and unmarked lines are identical.
- Read through the changes. For configuration files or contracts, it is often easiest to look for + and - pairs, which show a line that was edited rather than added or removed.
Frequently asked questions
- Does the diff work by line, word or character?
- It is line-based, like git diff and the Unix diff command. A line that changed in a single character is shown as one removed line and one added line. Word-level highlighting inside a line is not applied yet.
- Which algorithm is used?
- A line-based longest-common-subsequence diff, the same idea git uses. It finds a shortest sequence of line insertions and deletions that turns A into B, so moved blocks appear as a deletion in one place and an insertion in another. Long unchanged runs are collapsed to keep the output readable.
- Are trailing spaces and line endings significant?
- Line endings are normalised, so a Windows CRLF file and a Unix LF file with the same content show no differences. Trailing spaces and tabs inside a line are significant, however, because they are real differences in the text.
- Can I compare two files?
- Open each file in a text editor, copy its contents and paste them into A and B. Text files of tens of thousands of lines compare in well under a second in a modern browser.
- Is either text uploaded?
- No. The comparison runs entirely in your browser. You can compare draft contracts, source code with credentials, or private notes without anything leaving your device.
Related tools
• Remove Duplicate Lines Paste a list and keep only the first occurrence of each line, in the order you pasted it. • Sort Lines Put a list in alphabetical, natural, length or random order without leaving the page. • Word Counter Live word, character, sentence and paragraph counts for essays, posts, ads and anything with a length limit. • Case Converter Switch between UPPER, lower, Title, Sentence, camel, Pascal, snake and kebab case in one click.