Skip to content
Compare text

Diff Viewer

Visually compare differences between two text blocks and instantly identify additions, removals, and changes.
Line breaks and whitespace differences are also highlighted, helping you catch even subtle modifications.

This tool is useful for reviewing documents, proofreading content, and checking revisions in source code or specifications.
All comparisons are performed directly in your browser, and no text is sent to any server.

Guide: How to use & features

  • Paste the original text on the left and the modified text on the right, then click “Show diff.”
  • Additions appear in green and removals in red, making changes easy to spot.
  • After viewing, use the copy buttons under each pane to share either version.
  • Very large inputs may take a few seconds to render—please keep the tab open until it finishes.

Samples: Sample input & output

Compare two short files

Input

Left
console.log("hello");
Right
console.log("hello world");

Output

- console.log("hello");
+ console.log("hello world");

FAQ: Frequently asked questions

  • How are whitespace differences handled?

    Diffs are shown per line and include spaces, tabs, and line breaks. Cleaning up stray whitespace before pasting makes the output easier to read.
  • Is it okay for large snippets?

    Processing happens in the browser; a few thousand lines is typically fine. For bigger files, split them into sections before comparing.
  • Can I save the diff?

    Use copy to grab the rendered diff text. You can also take a screenshot or rely on your browser’s save/share features if needed.

Use cases: Common use cases

  • Comparing config or environment changes

    Quickly diff updated .env or YAML/JSON files to review tweaks and catch unintended edits.

  • Checking generated output

    Paste build artifacts or codegen results to see exactly what changed between runs.

  • Sharing minimal edits

    Extract only the relevant lines as a diff to discuss changes in PR comments or chat.

Notes: Notes & limitations

  • Work stays in your browser

    Inputs and outputs remain local. Closing the tab or clearing cache will remove any temporary state.

  • Validate critical data

    Results are helper outputs—double-check them before sending to production systems or sharing externally.

  • Large payloads depend on your device

    Very large text or files can feel slow in some browsers. Use a desktop environment for heavy workloads.

Result

Text Diff and Comparison Tool

This text diff tool compares two pieces of text and highlights added, removed, and changed lines. It is useful for code snippets, configuration files, documentation drafts, logs, generated output, and any situation where small changes are easy to miss by eye.

When to use it

  • Review code before committing: Compare an old snippet with a new one and catch accidental edits.
  • Check configuration changes: Compare JSON, YAML, .env, server configs, or deployment settings.
  • Edit documentation: See exactly which sentences or lines changed between two drafts.

Review tip

Whitespace, indentation, and line endings can appear as differences. When reviewing a diff, separate meaningful content changes from formatting-only changes so you can focus on the behavior or wording that actually changed.

Articles for this tool

Recent Articles

Use Case
2026-08-07

curl Options Cheat Sheet: What -X, -H and -d Actually Do

A reference for the curl options you meet in real API work: why -d already implies POST, how -d differs from --data-raw, the @ prefix that silently reads a file, single vs double quotes, and why -k and -L deserve more caution than they usually get.

Introduction
2026-08-06

Converting Between JSON Schema and Zod: How required Maps to .optional()

Inside a two-way converter that turns JSON Schema into a Zod schema and Zod code back into JSON Schema. Covers the inverted defaults between required and .optional(), the constraint mapping table, and how the Zod side is parsed without executing any code.

Use Case
2026-08-06

SQL Clause Order Reference: Why WHERE Can't See Your SELECT Alias

The order you write SQL clauses is not the order the database runs them. A reference for the logical execution order (FROM → WHERE → GROUP BY → HAVING → SELECT → ORDER BY → LIMIT), why aliases fail in WHERE, when to use WHERE vs HAVING, and the MySQL/PostgreSQL differences that bite.

Use Case
2026-08-06

Unified Diff Format Reference: Reading @@ Hunks in git diff Output

How to read the unified diff format git produces: what the four numbers in @@ -12,7 +12,9 @@ mean, why a one-character edit shows as a whole-line replacement, the whitespace and line-ending traps, \ No newline at end of file, combined @@@ diffs on merges, and rename detection via similarity index.

Use Case
2026-08-06

UTC to JST Reference: The 9-Hour Offset, Cheat Sheet & Timezone Pitfalls

Convert between UTC and JST (Japan Standard Time) with a cheat sheet. Covers what Z and +09:00 mean in ISO 8601, when JavaScript date parsing silently shifts by 9 hours, MySQL/PostgreSQL timezone behavior, and why GitHub Actions cron always runs in UTC.

Use Case
2026-08-04

CREATE TABLE Reference: MySQL vs PostgreSQL vs SQLite Types & Constraints

A cross-database CREATE TABLE (DDL) reference with cheat sheets for data types, auto-increment keys (AUTO_INCREMENT / IDENTITY / rowid), foreign key ON DELETE behavior, and the CHECK constraint that MySQL silently ignores.

Ad

Ad