How to use Text Diff
- Paste the original text on the left and the modified text on the right.
- Choose Lines or Words and any ignore options.
- Click Compare to see the unified view, side-by-side table and patch.
- Download the .patch file to apply the change with git apply.
Text Diff features
- Line mode with unified view, side-by-side table and a downloadable unified patch
- Word mode with inline insert/delete highlighting for prose
- Ignore whitespace and ignore case options
- Similarity percentage and added / removed / unchanged counts
- Handles large files quickly with anchor-based splitting for heavily changed inputs
- Configurable patch context lines
Text Diff example
Compare two configuration files
Input:
Left: port: 8080
logging: info
Right: port: 8443
tls: true
logging: warnOutput:
- port: 8080
+ port: 8443
+ tls: true
- logging: info
+ logging: warn
Similarity 40%Frequently asked questions about Text Diff
Which algorithm is used?
The Myers O(ND) shortest-edit-script algorithm — the same family used by git. Very large or very different inputs are split at unique anchor lines so results stay fast and readable.
Can I get a patch file?
Yes. The "Unified patch" output is in the standard unified diff format (--- / +++ / @@ hunks) and can be applied with git apply or patch -p1.
What does "Ignore whitespace" do?
Lines that differ only in spaces, tabs or indentation are treated as equal. Combine it with "Ignore case" for a case-insensitive comparison.
How does word mode differ from line mode?
Word mode aligns individual words and punctuation and shows insertions and deletions inline, which is ideal for prose and translations. Line mode is better for code and configuration files.
Is there a size limit?
Each text may be up to 2 MB. Word mode is limited to 400,000 characters in total because it works on a much finer granularity.
Technical notes
Lines are diffed with the Myers algorithm after stripping a common prefix and suffix. When the edit distance exceeds a budget, the engine finds lines that are unique on both sides, computes the longest increasing subsequence of their positions and recurses between those anchors — the same idea as patience diff — which keeps results readable for very different documents.