toolgarden.xyz
中文

Text Diff

Free online text diff using an open-source diff algorithm to highlight line and word changes

Left text (original)

0 lines

Right text (new)

0 lines

Original text
New text
Enter two texts to see differences

About this tool

Text diff finds additions, deletions, and unchanged content between versions of copy, configuration, logs, and documents. Results depend on comparison granularity and whitespace handling: lines suit code and paragraphs, while words or characters reveal inline edits.

The tool shows surface changes and does not understand the business meaning of clauses, numbers, or code. Rewrapping, indentation, and line-ending changes can create large diffs, so decide whether whitespace matters and use consistent encoding.

How to use it

  1. Place baseline and revision

    Make clear that the first or left text is older so additions and deletions are interpreted correctly.

  2. Choose an appropriate view

    Review the overall change, then focus on differing lines and words.

  3. Judge impact manually

    Inspect numbers, negations, punctuation, and structure to confirm intent.

Input and output example

Line-level location plus word-level highlighting. Only one number changed on the first line, but the whole line is flagged first.

Two texts
// left
port 8080
timeout 30s

// right
port 3000
timeout 30s
Differences
~ line 1: port [8080 → 3000]
  line 2: unchanged

Supported range and limits

Comparison granularity
Differences are located line by line, then highlighted word by word within changed lines; both shown at once
Algorithm
Longest common subsequence from an open-source diff library, the same approach git diff uses
Detects
Added lines, removed lines, and word-level edits within a line
Does not detect
A moved block shows as one deletion plus one insertion rather than as a move
No understanding of meaning
Paraphrases and reordered clauses appear as large differences, while a critical change to a number or unit may be one character
Better for JSON
When both sides are JSON, use JSON Diff; it compares by field and ignores formatting

When you would use it

  • Reviewing copy revisions

    Confirm that only agreed paragraphs changed and nothing was accidentally removed.

  • Diagnosing configuration drift

    Compare environment configuration or log fragments to locate changes.

  • Checking a final contract against the previous draft

    Word-level highlighting exposes single-character changes to amounts, dates and liability clauses; exactly what a read-through misses.

What to know before you start

  • Matching text does not prove identical system behavior because external context can differ.
  • LF versus CRLF, trailing spaces, and Unicode normalization create nonvisual differences.
  • Sensitive contracts and secrets remain subject to organizational copying and handling rules.

Related concepts

diff
A representation of additions and deletions that transform one text sequence into another.
whitespace
Spaces, tabs, and line breaks that do not appear as ordinary glyphs.

Frequently asked questions

Does Text Diff upload my content?
No. The comparison runs locally in your browser, and the two text inputs are not sent to a server.
Which diff algorithm does Text Diff use?
The tool uses the open-source jsdiff algorithm for line-level comparison, then highlights word-level changes inside modified lines.
Why does a moved block show as a deletion plus an insertion?
The algorithm is based on longest common subsequence: it decides whether a line exists on both sides without tracking movement. A relocated block has no corresponding position on either side, so it appears as one removal and one addition. git diff behaves the same way.
I changed one word; why is the whole line marked?
Line-level comparison flags the changed line first, then word-level highlighting runs inside it. The line marker looks like everything changed; the inline highlight is what pinpoints the word. Both levels are shown at once.