Text Diff
Compare two blocks of text and see line-by-line additions, removals, and unchanged context. Side-by-side or unified view.
What is this for?
Text Diff compares two blocks of text and shows you exactly which lines were added, removed, or stayed the same. It's the line-level diff engine you'd see in a code review or git diff output — but it works on any text, whether it's in version control or not. Additions show in green, removals in red, unchanged lines in plain text.
When to use it
- Spotting what changed between two emails, contracts, or pasted text blobs that "look the same" to the naked eye.
- Comparing configuration files or environment variables across two environments (staging versus production).
- Reviewing edits to copy that was changed in Word, Google Docs, or similar — especially useful when someone else made the changes and you need to audit them.
- Diffing two query results, log snippets, or JSON responses to see what differs (pair with JSON Formatter to canonicalize structure first).
- Quick sanity check on a find-and-replace operation before you commit it or apply it widely.
- Comparing two versions of a script, SQL file, or configuration without needing git or a terminal.
How it works
- Paste or upload your original text into the left box and the new version into the right box.
- The tool splits both inputs into lines and runs a Myers diff algorithm to find the shortest sequence of edits.
- Choose side-by-side view to see the original on the left and new version on the right (easiest for scanning), or unified view to see changes in context like
git diff(better for sharing or printing). - Toggle ignore whitespace to treat lines as identical even if they differ only in spaces or indentation. Toggle ignore case to treat "TODO" and "todo" as the same line.
- The diff runs entirely in your browser — nothing is sent to a server.
View modes
- Side-by-side — original on the left, new version on the right. Easier to scan for small, localised changes. Good for reviewing prose or config tweaks.
- Unified — shows changes in context, closer to terminal
difforgit diffoutput. Better for sharing, printing, or when changes are sparse and you need surrounding lines for context.
Common gotchas
- This is a line diff, not a character or word diff. If a single character changes in the middle of a long line, the entire line is marked as changed. For fine-grained prose comparison, consider a word-level tool instead.
- Ignore whitespace compares but does not hide. Lines that differ only in trailing spaces or indentation will show as unchanged in the diff, but the original whitespace is still rendered on screen.
- Ignore case behaves the same way. "TODO" and "todo" compare equal, but the original casing is shown in the output.
- No move detection. If you reorder two lines, the diff shows them as one removal and one addition, not as a "moved" pair. The algorithm detects edits, not rearrangements.
- Large inputs (10,000+ lines) will be slow. The underlying algorithm is O(m·n) in time complexity — fine for typical files, but noticeably sluggish for very large texts. Diff smaller chunks instead.
- Trailing newlines count. Two inputs that differ only in whether they end with a newline will show a trailing addition or removal.