Text Diff
Compare two texts side by side or inline, with changed words highlighted, ignore whitespace or case, and copy a unified patch.
0 characters · 1 line
0 characters · 1 line
Shortcut: Ctrl/⌘ + Enter to swap sides
Differences
Enter two texts above to see what changed.
How to use
- Paste the old version into “Original text” and the new version into “Changed text”, or click “Example” to try it out.
- The differences below update as you type: red lines were removed, green lines were added, and a darker highlight marks the words that changed within a line.
- Choose “Side by side” to compare the two versions in columns, or “Inline” to list removed and added lines one above the other (easier to read on phones).
- Turn on “Ignore whitespace” or “Ignore case” to focus on real content changes. “Swap sides” exchanges the two texts.
- Click “Copy patch” or “Download patch” to get the result as a unified diff for git apply or patch.
FAQ
Is my text uploaded?
No. The comparison runs entirely in your browser, and your text never leaves your device.
How does word highlighting work with Chinese?
Languages that separate words with spaces are highlighted word by word. Chinese, Japanese and full-width characters have no spaces between words, so each of those characters is compared on its own, just like character mode. Emoji (including skin tones and other combinations) and letters with combining accents always count as one character and are never split.
What does “Ignore whitespace” ignore?
Lines are compared with all whitespace removed: spaces, tabs, full-width spaces and whether the text ends with a line break, much like git diff -w. For example, “a b” and “ab” count as the same line. Blank lines still count as lines.
What does “(no line break at end)” mean?
The last line of that text is not followed by a line break. Many programs and git treat this as a change, so it is shown here too, and the patch contains “\ No newline at end of file”. Turn on “Ignore whitespace” if it does not matter to you. Windows line breaks (CRLF) and plain line breaks (LF) are always treated as the same.
What format is the patch?
A standard unified diff (as produced by diff -u or git diff) with 3 unchanged lines around each change. The file names are original and modified, and you can apply it to the original file with patch or git apply. With an ignore option on, lines that count as the same are not part of the patch’s changes.
How much text can I compare?
Up to 2 million characters and 100,000 lines on each side. Longer texts are compared in the background and update once you pause typing. Unchanged stretches are folded so only 3 lines around each change are shown; click to expand them. If the texts are extremely different, the comparison may hit its time limit and stop; compare smaller parts in that case.
Related tools
Find & Replace
Find and replace text in bulk with case and whole-word options or regular expressions with $1 groups, with matches highlighted.Whitespace Cleaner
Trim trailing spaces, collapse blank lines and repeated spaces, remove zero-width and non-breaking spaces, convert tabs and line endings.JSON Formatter
Beautify, minify and validate JSON with precise line and column error locations.Case Converter
Convert text to UPPERCASE, lowercase, Title Case, Sentence case, camelCase, PascalCase, snake_case, kebab-case and more, all at once.