Text Diff
Interactive StudioCompare two blocks of text and highlight the added and removed lines. Instant feedback with zero server storage.
Loading tool…
About Text Diff
This tool compares two blocks of text line by line and highlights what changed between them, using the same underlying idea as the "diff" utilities built into version control systems like Git. Rather than just flagging that a line differs, it computes the longest common subsequence (LCS) — the longest run of lines that appear, in order, in both versions — via dynamic programming. Any line that's part of that shared sequence is marked unchanged; everything else is classified as removed (present in the original but not the longest common thread) or added (present in the changed version but not in it).
This line-level, LCS-based approach is why moving a paragraph or inserting a single line in the middle of a document doesn't cause every following line to show as changed — the algorithm finds the longest matching skeleton between the two texts and only flags the genuine insertions and deletions around it, rather than doing a naive line-by-line positional comparison that would misalign everything after the first edit.
This is useful for reviewing edits between two drafts of a document, comparing two versions of a config file or code snippet pasted from different sources, or spotting exactly what text changed in a paragraph that was revised.
How to use Text Diff
- Paste the original text on one side and the changed text on the other.
- Added and removed lines are highlighted.
- Review the changes line by line.
Worked examples
Input: Original: a, b, c. Changed: a, c, d.
Result: Line b is shown as removed and line d as added. Lines a and c are unchanged.
Background
The comparison finds the longest common subsequence of lines, the longest run of lines that appear in the same order in both texts. Lines outside it are marked removed or added. Git and other diff tools rely on the same idea.
The comparison is line-based, so changing one word marks the whole line as changed. Differences in trailing whitespace or line endings also show up as changes.
Common mistakes
- Missing changes that are only whitespace.
- Comparing text with different line endings and seeing every line differ.
- Reading a moved block as a delete plus an add.
Frequently Asked Questions
Frequently Paired With
Fast, local-first developer micro-tools with zero tracking or latency.
Find and Replace
Find and replace text, with regex support.
Username Generator
Generate random, memorable usernames.
Word Counter
Count words, characters, sentences with readability & density analysis.
Base64 Encoder
Encode or decode Base64 text.
