Text and Data Tools

Text Diff

Enter the original and revised text side by side to identify inserted, deleted, and retained lines.

Original Text

Changed Text

Differences

View copyable diff text

Use a real line-diff algorithm to identify additions, deletions, and unchanged text, including Unicode and emoji.

Your input is processed only in your browser and is never uploaded to a server.

About This Tool

Text Diff finds lines retained in both versions instead of comparing only matching line numbers. Inserting a line in the middle does not incorrectly mark every later line as changed. Colors, symbols, and line numbers explain the result together.

How to Use It

  1. Enter the original text on the left and the revised text on the right.
  2. Click Compare. Large text is not compared again on every keystroke.
  3. Review green additions, red deletions, and unchanged lines, with symbols and old/new line numbers.
  4. Copy or download the diff as TXT. Reduce the comparison scope if the input exceeds the processing budget.

Examples

  • Compare A / B / C with A / X / B / C: only X is added; B and C remain unchanged.
  • A deleted line has a “-” marker and an added line has “+”. A replacement can appear as a deletion followed by an addition.
  • Text containing <script> is displayed literally and never executed.

Rules and Limits

The tool uses a longest common subsequence (LCS) algorithm and first removes matching prefixes and suffixes to reduce work. Line endings are normalized to LF. Byte, line, and matrix-cell limits protect the browser; long texts with extensive differences produce a clear error. This is a line-level comparison, not a character- or word-level diff. Combined input is limited to 1 MiB, each side to 10,000 lines, and the LCS matrix to 4,000,000 cells. The preview shows up to 2,000 diff entries; copying and downloading includes the complete calculated result.

Common Uses

  • Review changes to settings, documentation, or logs.
  • Locate inserted and deleted list entries.
  • Compare versions containing Chinese, Japanese, emoji, or other Unicode text.

Privacy

Text processing, file reading, conversion, and previews all run locally in this browser. Input is not uploaded or automatically saved. No backend, database, online API, or third-party CDN is used. Copying and downloading also happen locally.

FAQ

What do Added and Removed mean?

Added marks a line introduced in the revised text. Removed marks a line deleted from the original. Matching content is unchanged.

Why not just compare the same line numbers?

Insertions and deletions shift later line numbers. LCS recognizes retained content instead of treating all later text as modified.

Can I compare empty text?

Yes. If one side is empty, the other side’s lines are additions or deletions. If both sides are empty, there is no difference.

Can I compare files of any size?

No. Byte, line, and processing budgets prevent long main-thread stalls. The tool asks you to reduce the scope when a limit is reached.

Is the text uploaded or executed?

No. Comparison is local, and results use safe text nodes. Even script tags are displayed only as characters.

Back to Developer Tools