Text Diff
Paste two texts and instantly see every line that was added, removed, or unchanged.
What Is a Text Diff?
A text diff compares two blocks of text line by line and highlights exactly what changed. Lines unique to Text A (the original) are shown in red — they were removed. Lines unique to Text B (the changed version) are shown in green — they were added. Lines that appear in both are unchanged.
This tool uses the Longest Common Subsequence (LCS) algorithm, the same approach used by Git, command-line diff, and code editors. Everything runs in your browser — no data is sent to a server.
When to Use This Tool
Text Diff is useful any time you need to compare two versions of something: contract revisions, config file changes, two drafts of a document, API response payloads, or copied-and-edited notes. For structured data, you may want to also try the JSON Diff tool.
FAQ
- How do I compare two text files online?
- Paste the original text into Text A and the revised text into Text B. The diff runs automatically. Added lines appear in green, removed lines in red.
- What do the colors mean?
- Green lines exist in Text B but not Text A — they were added. Red lines exist in Text A but not Text B — they were removed. Lines with no color are identical in both texts.
- What is the difference between Split and Unified view?
- Split view shows Text A and Text B side by side with matching lines aligned. Unified view interleaves additions and removals in a single column, similar to the output of
git diff. - Can I compare code with this tool?
- Yes — paste any plain text including code, config files, JSON, Markdown, or prose. For JSON specifically, the JSON Diff tool provides deeper structural comparison.
- Is my text sent to a server?
- No. All processing happens in your browser with JavaScript. Your text is never uploaded anywhere.