Text Diff Checker

Compare two texts and highlight every difference — added, removed, and unchanged content. Line-by-line, word-by-word, or character-by-character diff with side-by-side, inline, and unified (patch) views. Ignore case, whitespace, or blank lines. Free, instant, nothing uploaded.

Original (A)
5 lines30 words161 chars
Modified (B)
6 lines37 words192 chars
Similarity
58%
Lines added
+1
Lines removed
-0
Words added
+13
Words removed
-6
Chars added
+63
Chars removed
-32
Unchanged chars
129
Similarity58%
Diff Result — Side by Side
AddedRemoved
Original (A)
1
2
3
4
5
The quick brown fox jumps over the lazy dog. This is the original version of the document. It has three lines of text. The weather is sunny today. Version: 1.0.0
Modified (B)
1
2
3
4
5
6
The quick brown fox leaps over the lazy cat. This is the modified version of the document. It now has four lines of text. The weather is cloudy today. A new line was added here. Version: 2.0.0
Changes Only
Removed from A6 words
jumpsdog.originalthreesunny1.0.0
+ Added in B13 words
leapscat.modified nowfourcloudy A new line was added here.2.0.0

Free Text Diff Checker — Compare Two Texts Online

This free text diff checker compares two texts and highlights every difference — additions, deletions, and unchanged content — using a proper LCS (Longest Common Subsequence) diff algorithm. Compare by line, word, or character. View results side-by-side, inline, or as a unified patch file. Ignore case, whitespace, or blank lines. Export changes as a .patch file or plain-text diff. Everything runs locally in your browser — nothing is uploaded.

All Features

  • Line-by-line diff — Compare text line by line. Best for code, CSV, config files, and logs.
  • Word-by-word diff — Compare word by word. Best for documents, articles, and prose.
  • Character-by-character diff — Find every single character difference including typos and punctuation.
  • Side-by-side split view — Original on the left, modified on the right with changes highlighted.
  • Inline view — Additions and deletions shown in a single text stream.
  • Unified patch format — Standard diff format compatible with git and patch tools.
  • Similarity score — Percentage similarity between the two texts with visual bar.
  • Change statistics — Lines added/removed, words added/removed, characters added/removed.
  • Changes-only panel — Shows only the additions and deletions side by side.
  • Ignore case — Compare case-insensitively.
  • Ignore whitespace — Ignore indentation and space changes.
  • Ignore blank lines — Skip empty line differences.
  • Line numbers — Optional line numbers in the diff view.
  • Upload files — Open .txt, .md, .csv, .json, .js, .html, .css, .log files.
  • Download .patch — Save as a unified diff patch file.
  • Swap A and B — Instantly reverse the comparison direction.

Who Uses a Text Diff Tool?

Developers compare code snippets, config files, and JSON responses. Writers track changes between document versions before and after editing. Students compare essay drafts. SEO specialists compare page content for changes. System administrators compare log files and config files. Data analysts compare CSV exports. Anyone who needs to see exactly what changed between two versions of any text.

Frequently Asked Questions

What is a text diff?

A text diff (short for difference) identifies and displays the changes between two versions of a text. It shows which lines, words, or characters were added (insertions), removed (deletions), and which parts stayed the same (unchanged). This tool uses the LCS (Longest Common Subsequence) algorithm — the same algorithm used by git diff and most version control systems.

What is the difference between line diff, word diff, and character diff?

Line diff compares entire lines — best for code and structured text. Word diff compares individual words — best for prose and documents. Character diff compares individual characters — best for finding exact typos and precise character-level changes. Use word diff for most document comparison tasks and line diff for code.

What is unified diff format?

Unified diff format (also called patch format) is a standard text representation of differences used by git, GNU patch, and most code review tools. Lines starting with + are additions, lines starting with - are deletions, and lines with a space are context (unchanged). The output can be saved as a .patch file and applied to restore changes.

Can I compare code files?

Yes — use Line diff mode for code. Upload .js, .ts, .css, .html, .json, .yaml, or any text-based source file using the Open button. The diff highlights exactly which lines changed. Use "Ignore whitespace" to skip indentation-only changes when comparing reformatted code.

Is my text uploaded to a server?

No. All text comparison runs entirely in your browser using JavaScript. Your text never leaves your device — making it safe to compare sensitive documents, private code, or confidential content.

What does the similarity percentage mean?

Similarity is calculated as (unchanged characters) / (total characters) × 100%. A score of 100% means the texts are identical. A score of 0% means they share no common content. Note that this is character-level similarity regardless of the selected diff mode.

Can I use this to compare JSON, CSV, or HTML?

Yes — any text-based format works. For JSON: paste the JSON directly and use Line diff to see which properties changed. For CSV: use Line diff to see which rows changed. For HTML: use either Line or Word diff. For best results with JSON, format both inputs with consistent indentation before comparing.