Text Diff
Inline character, word, and line-level diff between two texts
About this tool
The Text Diff tool shows inline character-level differences between two text inputs. Unlike line-based diff tools, it highlights exactly which characters were added, removed, or changed within each word β ideal for comparing short strings, config values, API responses, or variable names.
When to use it
- βSpotting typos between two similar strings or error messages
- βComparing two versions of a config value or environment variable
- βFinding subtle differences in API endpoint URLs or query strings
- βReviewing changes in auto-generated code or template output
Tips
- βFor large files with many line changes, use the Diff Checker tool instead β it handles line-level comparison better.
- βThe inline view is best for strings under 500 characters where character-level context matters most.
- βCopy either the original or modified text to compare against a clipboard value quickly.
Frequently asked questions
What is the difference between character, word, and line diff modes?
Character diff highlights individual character insertions and deletions β best for spotting single-character typos and invisible character differences. Word diff groups changes by word boundaries β best for prose and natural language. Line diff compares entire lines β best for code and config files where a whole line is typically one logical unit. Choose the granularity that matches your content.
When should I use text diff vs the Diff Checker tool?
Use this Text Diff tool for short to medium strings where character-level granularity matters: variable names, error messages, URLs, connection strings. Use the Diff Checker for comparing large files or multi-line code blocks where you want the familiar git-style line-by-line view with context lines and change counts per line.
How does the diff algorithm work?
This tool uses the Myers diff algorithm, the same algorithm used by git. It finds the shortest edit script (minimum number of insertions and deletions) to transform the original text into the modified text. The algorithm runs in O(ND) time where N is the text length and D is the number of differences β it's extremely fast even for large inputs.
Why do I see differences when the texts look identical?
Common invisible culprits: different line endings (CRLF vs LF), leading or trailing whitespace, zero-width characters (U+200B, U+FEFF BOM), smart quotes vs straight quotes, or non-breaking spaces ( ) that look like regular spaces. The character diff mode is the best way to find these β it will reveal the hidden character as an added or removed character.