Skip to content
brownie.tools

Text Diff

Filter spacing and case differences, inspect changed words or characters, and export the raw patch.

Options
Paste text in both panels above to see the diff.

Runs locally in your browser. Nothing is uploaded or sent to a server.

Paste two versions into Original and Modified to get highlighted text differences automatically after a 300 ms pause. Select Ignore whitespace, Ignore case, Trim lines, or Ignore blank lines to hide selected formatting differences. Choose Word or Character under Changed-line precision, then review Side by side or Inline. Comparison runs on your device. Copy patch and Download .diff export the raw differences, including edits hidden by your review filters.

Updated

How can you highlight substantive edits instead of formatting changes?

Select Ignore whitespace to hide repeated spacing and line-edge whitespace, then review the remaining word highlights. Add Ignore case or Ignore blank lines only when capitalization or blank rows do not matter. Text Diff applies these rules automatically, but it does not decide whether an edit changes meaning.

For example, compare Delivery is Friday. with Delivery is Monday.. With Ignore whitespace selected, the spacing difference is suppressed and the word replacement remains visible: Friday is removed and Monday is added. The result contains one modified line, one word removed, and one word added. This separates a scheduling edit from spacing noise without interpreting the sentence.

How comparison filters handle specific text differences
OriginalModifiedSelected optionResult
Hello WorldHello WorldIgnore whitespaceEqual
HelloWorldHello WorldIgnore whitespaceModified
Hello World Hello WorldTrim linesEqual
Hello WorldHello WorldTrim linesModified
APPROVEDapprovedIgnore caseEqual

Ignore whitespace collapses whitespace runs to a single space and trims the edges; it does not remove every space. Trim lines only trims the edges. Ignore blank lines excludes empty and whitespace-only rows while retaining source line numbers, so gaps in the displayed numbering are expected. Each option changes the comparison and statistics without rewriting the input fields.

Keep filters off when those details carry meaning. An indentation change in code or a capitalization change in an identifier deserves review even if the words look similar. Start with the smallest relevant filter set, then disable the filters for a final pass over the full textual changes.

How does the automatic line comparison work?

Paste the earlier text into Original and the revision into Modified. The comparison runs in your browser after a 300 ms pause in typing; there is no comparison button to press. All four ignore options start unchecked. You can also load or drop UTF-8 .txt files. The reader rejects other filename extensions, invalid UTF-8, and null characters, and converts CRLF or standalone CR line endings to LF.

The tool uses jsdiff to compare lines after applying your selected normalization rules. Within each change block, removed and added lines are paired in order as modified rows. Extra lines remain additions or deletions. Pairing is a display aid rather than an assessment of sentence similarity: replacing two adjacent lines with one produces one paired replacement and one remaining removal.

Use this comparison for pasted prose, code, configuration, or rows of plain text. It compares their characters and lines, not document structure or program behavior. A rewritten sentence that keeps the same meaning can still produce highlights, while a small word replacement can have a large practical effect.

What do the markers, highlights, and counts mean?

A green + marks an added line, a red - marks a removed line, and a yellow ~ marks a paired replacement. Matching rows have no change marker. Removed text is struck through and added text is underlined, so the distinction does not depend on color alone. Each side shows its own source line numbers.

The lines changed count adds added, removed, and modified rows. One paired replacement therefore counts as one changed line, rather than one deletion plus one insertion. Word totals count letters and numbers, including words containing internal apostrophes; punctuation-only edits add no words. Changing Hello. to Hello! still marks a modified line, but the added and removed word counts are both zero.

When should you choose Word or Character precision?

Changed-line precision starts with Word. Choose Character to inspect a changed letter, digit, or punctuation mark within a paired replacement. This changes the detail of the highlighting, while the word totals still come from word comparison. The counts do not become character counts when you switch precision.

Character precision has a limit of 20,000 combined characters per line pair. A 10,000-character original line paired with a 10,000-character modified line is within that limit. Adding one more character to either line exceeds it: the pair receives whole-line highlights and a limit notice. This is a per-pair precision limit, not a stated file-size allowance. Unpaired added or removed lines are highlighted as whole lines.

How can you navigate and export the changes?

Side by side places the two versions in adjacent columns. Inline places a modified original line before its replacement. The initial view is Side by side at viewport widths of at least 1024 pixels and Inline below that width. Both views use the same comparison results. Enable Only changes to hide equal rows, then use Previous change and Next change. Within the results area, Alt + Up Arrow and Alt + Down Arrow also navigate changes, wrapping at either end.

Copy patch copies a unified patch, and Download .diff saves the same patch as changes.diff. It uses original and changed file headers and @@ hunk headers, with three context lines around edits where available. Export always compares the raw inputs: changes hidden by your filters still appear in the patch.

If you want normalization reflected in the exported patch, prepare normalized inputs first. The Whitespace Remover is available for that preparation; keep the original copies so you can review what was removed. For comparisons involving repeated rows, inspect them before using the Duplicate Line Remover, since removing repetitions changes the material being compared. Browse Text Tools for other text preparation tasks.

How to Use Text Diff

  1. Original and Modified

    Paste the earlier version into Original and the edited version into Modified, or use Load or drop a UTF-8 .txt file for each input. Results update automatically after a 300 ms pause.

  2. Ignore whitespace

    Select Ignore whitespace for repeated spacing, Trim lines for edge spacing, Ignore case for capitalization, or Ignore blank lines for empty rows. Leave meaningful differences unfiltered.

  3. Changed-line precision

    Choose Word or Character for paired changed lines. Character precision shows whole-line changes when the two lines exceed 20,000 combined characters.

  4. Side by side or Inline

    Choose Side by side or Inline. Enable Only changes to hide matching rows, then use Previous change or Next change to move through the remaining edits.

  5. Copy patch or Download .diff

    Use Copy patch for the clipboard or Download .diff for changes.diff. Both export the raw texts with three context lines around changes, regardless of review filters.

Frequently Asked Questions