✍️ Text & Writing

Text Diff

Paste the before and after versions of your text, then click "Compare" — changed lines appear highlighted in green and red. Works for documents, emails, code, or anything you want to track. Your text never leaves your browser.

Examples (click to try)
Drop a file here, or click to choose (.txt, .md, .csv…)
Drop a file here, or click to choose (.txt, .md, .csv…)

Paste text in both fields and click "Compare" — the diff will appear here.

How to Use the Text Diff Tool

Paste your original text into the "Before" area and your revised text into the "After" area, then click the "Compare" button. The tool performs a line-by-line diff and highlights any changed lines.

  • Green (added lines): Lines that exist only in the revised text.
  • Red (deleted lines): Lines that exist only in the original text.
  • Unchanged lines: Lines common to both texts are shown without any highlight.
  • Changes within a line: When a line was replaced, only the words that actually changed are highlighted more strongly. Toggle it with "Highlight changes within a line".
  • Unified or side by side: Switch to the side-by-side view to see before and after in two columns with line numbers.
  • Load a file: Drop a text file onto the area below either input to fill it. The file is read in your browser and never uploaded.
  • Summary badges: The number of added, deleted and changed lines is shown in the badges above the result.

For example, if you change the line port = 8080 to port = 443, the result shows a deleted line - port = 8080 (red) and an added line + port = 443 (green), with only 8080 and 443 highlighted inside them.

There is no line limit. Comparing tens of thousands of lines works directly, because the tool splits the problem using common runs and lines that appear exactly once on each side.

Useful Scenarios

  • Reviewing changes between document, email, or contract revisions
  • Quick diff check before a code review
  • Proofreading blog posts or tracking edits in written content
  • Comparing configuration files or settings text before and after changes

How to Read a Line Diff

The unit of comparison is a line: a changed line is reported as the old line removed and the new line added. Within such a pair, the words that actually differ are highlighted, so a one-character edit does not look like a wholesale rewrite. Spaces, tabs and newline positions are part of the input and can produce differences even when the text looks similar. The tool has no understanding of syntax or meaning, so it is not a substitute for a code review.

Use JSON Diff for a structural comparison that ignores object-key order, or the Invisible Character Remover when hidden characters are suspected.

Frequently Asked Questions

How is the diff calculated?
With patience diff. Common runs at the start and end are removed first, then lines that appear exactly once on each side are used as anchors to split the problem, and only the small remaining regions are solved with LCS (longest common subsequence). There is no line limit, so comparing tens of thousands of lines works directly. For replaced lines, "Highlight changes within a line" marks only the words that actually changed. Line-ending differences (CRLF vs LF) are ignored by default, with a note when the two sides differ.
Does it work on smartphones?
Yes, in any browser on phone, tablet or desktop. On a narrow screen the two inputs stack vertically. The side-by-side view places before and after next to each other, so it reads best on a wide screen; the unified view suits narrow screens. No installation or sign-up.
Can I view it side by side, or load a file?
Yes. Switch to "Side by side" in the toolbar to see before and after in two columns with line numbers. Drop a text file (.txt, .md, .csv and similar) onto the area below either input to fill it. Files are read in your browser and never uploaded, up to 20 MB.
What happens with very large texts?
There is no line limit on the comparison itself. Rendering is capped at the first 5,000 rows and the number of omitted rows is shown above the result, because drawing hundreds of thousands of rows makes the browser sluggish. When a great deal has changed, the within-line highlighting is skipped automatically.
Is my input sent to a server?
No. All diff calculations are performed entirely in your browser. Your input is never sent to or stored on any server, so it is safe to compare confidential documents.