Text Diff Checker

Compare two texts and see differences highlighted instantly

Free diff checker to compare text or code side by side. Additions highlighted in green, deletions in red, with character-level detail. 100% client-side.

Paste text in both panels and click Compare

Text Diff Guide

What is a Diff?

A diff (short for difference) compares two versions of text and highlights what was added, removed, or changed between them. Originally a Unix command-line tool, diff is now essential for software development, code review, and configuration management.

Understanding Diff Output

  • Green lines (+): Added in the modified version. These lines exist in the right panel but not the left.
  • Red lines (-): Removed from the original. These lines exist in the left panel but not the right.
  • Character highlighting: Within changed lines, the specific characters that differ are highlighted with a darker shade so you can spot the exact change.
  • Unchanged lines: Lines that are identical in both versions are shown without any highlight.

Side-by-Side vs Inline View

Side-by-side shows original and modified text in two columns. Matching lines are aligned so you can compare them visually. Best for reviewing small, targeted changes.

Inline (unified) shows all changes in a single column with deletions and additions stacked. This is the same format used by git diff and pull request reviews. Best for reviewing larger changes or getting an overview.

Common Use Cases

  • Code review: Compare two versions of a function, class, or file to see what changed.
  • Config changes: Diff JSON, YAML, TOML, or .env files before deploying to catch unintended changes.
  • SQL queries: Compare original and modified queries to verify the difference.
  • Merge conflicts: Paste both versions to understand conflicting changes.
  • Document comparison: Compare drafts, API responses, or log output.

Text Diff FAQ

What is a diff checker?

A diff checker compares two blocks of text and highlights the differences. It shows which lines were added, removed, or changed. Developers use diff checkers for code review, comparing config files, and resolving merge conflicts.

How do I compare two text files online?

Paste the original text in the left panel and the modified text in the right panel, then click Compare. Additions are shown in green, deletions in red, with character-level highlighting for changed lines.

What is the difference between inline and side-by-side diff?

Side-by-side shows both texts in two columns for easy visual comparison. Inline shows all changes in a single column with deletions and additions stacked vertically, similar to git diff output.

Can I compare code with this tool?

Yes. This diff tool works with any text: source code (JavaScript, Python, Java), config files (JSON, YAML), SQL queries, log files, CSV data, and plain text. It preserves whitespace and indentation.

Is my data safe?

Yes. This tool runs 100% in your browser. No text is sent to any server. Your data never leaves your machine, making it safe for comparing sensitive code or private documents.

What do the colors mean?

Green = added (present in modified, not in original). Red = deleted (present in original, not in modified). Within changed lines, a darker shade highlights the exact characters that differ.

Can I compare JSON or config files?

Yes. Paste your JSON, YAML, TOML, or any config file text into both panels. The diff will highlight every changed line and character. For JSON, consider formatting both inputs consistently first using our JSON Validator.

How does character-level highlighting work?

When a line is modified (not fully added or removed), the tool compares the old and new versions character by character. The specific words or characters that changed are highlighted with a darker shade within the line, so you can pinpoint the exact edit.