Text Tools
Text Diff
Compare two texts side by side in your browser. Line, word, and character diff with added and removed highlights and a unified patch.
Summary
Tokens in A (line)
5
Tokens in B (line)
6
Unchanged
4
Removed (A only)
1
Added (B only)
2
Side by side
| 1 | function greet(name) { | |
| | ||
| 2 | - | return "Hello, " + name; |
| 3 | } | |
| 4 | | |
| 5 | greet("Alice"); | |
| |
| 1 | function greet(name) { | |
| 2 | + | return `Hello, ${name}!`; |
| | ||
| 3 | } | |
| 4 | | |
| 5 | greet("Alice"); | |
| 6 | + | greet("Bob"); |
Unified diff
Lines starting with - are only in A, lines starting with + are only in B, lines starting with a space exist in both.
function greet(name) {
+ return `Hello, ${name}!`;
- return "Hello, " + name;
}
greet("Alice");
+greet("Bob");How to use
- Paste the original text into Original (A) and the new version into Changed (B).
- Pick a comparison mode: Line for code and config, Word for prose, or Character for short strings.
- Read the summary stats and the side-by-side panes, with removed lines marked rose and added lines marked emerald.
- Use Swap A and B, Clear all, or Copy unified diff to grab a patch-style view of the change.
About this tool
Text Diff compares two pieces of text and shows exactly what changed between them. Paste an Original (A) and a Changed (B) version, then pick how you want to compare them: by line for code and config diffs, by word for prose edits, or by character for fine-grained string changes. The tool runs a longest-common-subsequence algorithm in your browser, marks every removed token in rose and every added token in emerald, and lays the two versions out in a side-by-side view with line numbers when comparing line by line. Stats at the top show how many tokens are unchanged, removed, or added, and a unified diff block at the bottom is ready to copy and paste into a pull request, code review, or change log. Comparing happens entirely in your browser, so contracts, source code, and any sensitive text you are reviewing never leave your device.
Free to use. Works in your browser. No signup, no login.
Related tools