Text Diff Tool
Compare two texts instantly β side-by-side or unified view. Character-level highlights show exactly what changed. Copy the result as a standard .patch file.
100% Private Β· No Uploads Β· Runs Entirely in Your Browser
What makes this diff tool different
Character-level highlighting
Changed lines show exactly which characters differ β not just which lines. Spot a single typo in a 200-character line.
Three whitespace modes
Compare normally, ignore leading/trailing whitespace, or ignore all whitespace. Useful for code formatting changes.
Copy as unified patch
One click copies a standard git-format patch you can save as .patch and apply with git apply.
Similarity score
See an instant percentage showing how similar the two texts are β helpful for proofreading or spotting minor edits.
Frequently asked questions
Is my text sent to a server?
No. The diff algorithm runs entirely in JavaScript in your browser. Your text never leaves your device β there are no API calls, no uploads, and no logging.
What does "character-level highlighting" mean?
When two adjacent lines are changed (one removed, one added), the tool highlights only the characters that actually differ β not the whole line. This makes it easy to spot a single word or character change inside a long line.
What is the "ignore whitespace" option?
Three modes are available. "Normal" treats all whitespace as significant. "Ignore leading/trailing" trims each line before comparing, so indentation differences are invisible. "Ignore all whitespace" removes every space and tab before comparing β useful for comparing minified vs. formatted code.
What is the "Copy as patch" button?
It copies the diff in standard unified diff (git patch) format β the same format produced by git diff. The patch starts with --- and +++ headers, followed by @@ hunk markers and Β±-prefixed lines. You can save it as a .patch file and apply it with git apply or patch.
What algorithm does the diff use?
The tool uses the classic LCS (Longest Common Subsequence) algorithm on line arrays, implemented with a flat typed array (Int32Array) for efficiency. This is the same fundamental approach used by diff, git diff, and most diff tools.
Is there a limit on how much text I can compare?
Each side is capped at 2,000 lines before processing to keep the browser responsive. For most documents, config files, and code files this is more than enough. Very large texts (thousands of lines) should be compared with a dedicated command-line diff tool.
More Productivity Tools
Explore our other privacy-focused tools designed to boost your productivity
JSON Formatter & Validator
Format, validate, and explore JSON & XML in your browser β tree view, table view, sort keys, no uploads
UTM Link Builder
Build UTM-tagged campaign URLs instantly β source, medium, campaign presets, custom params, one-click copy. No uploads.
Bulk File Renamer
Rename files in bulk β add prefix/suffix, find & replace, change case, auto-number β ZIP download, no uploads.