Inline character diff

Unified diff

Text Diff Checker — Tips & Guide

A diff checker compares two versions of a text and shows exactly what has changed — which lines were added, removed, or modified. It's an essential tool for code review, document comparison, and debugging.

Review Code Changes

Paste the old and new versions of a function or file to see exactly what changed. The line-level diff pinpoints the precise modifications, making code review faster and more accurate.

Compare Document Versions

Paste two versions of a document, contract, or article to detect edits, additions, or deletions. The unified view makes reviewing tracked changes easy without a word processor.

Debug API Responses

Paste two JSON or XML API responses side by side to quickly see what changed between versions. This is especially useful when diagnosing regressions or unexpected behavior.

A diff checker is a tool that compares two pieces of text and highlights the differences between them. It identifies which lines (or characters) were added, removed, or left unchanged. The term "diff" comes from the Unix diff command, which has been used since the 1970s to compare files. Diff checkers are widely used in software development (code review), writing (document revision), and data analysis.

Paste the original version of your text into the "Original Text" box on the left, and the new version into the "Changed Text" box on the right, then click "Compare". The diff view will appear below, showing lines removed in red with a - prefix and lines added in green with a + prefix. Lines that are the same in both versions are shown in white. Enable "Inline character diff" for character-level highlighting within changed lines.

The unified diff format is a standard text format for representing the differences between two files. It shows a few lines of context around each change, with - marking lines removed from the original and + marking lines added in the new version. It was standardized by POSIX and is the default output format of the git diff command. The "Copy diff" button exports the diff in this format.

git diff uses a Myers diff algorithm (a refined LCS-based approach) to compute the minimal edit distance between two versions of a file. It outputs differences in unified diff format, showing the changed lines with surrounding context. When you run git diff HEAD~1, git compares the current working tree against the previous commit, line by line, and shows what was added or removed in each file.

Developer Pro Tips

5 Things Experts Know

01
Validate JSON Before Parsing

Always validate JSON from external sources before passing to your parser. A single malformed response can crash an entire data pipeline if unhandled.

02
Use Named Capture Groups in Regex

Replace numbered groups like (\d+) with named groups (?P\d+). Your code becomes self-documenting and refactoring-safe.

03
Base64 is Encoding, Not Encryption

Base64 is trivially reversible. Never use it to "hide" sensitive data. It is only for safe transmission of binary data over text-based protocols.

04
SHA-256 vs MD5

Use SHA-256 for any integrity check that matters. MD5 is broken for security purposes — collisions can be generated in seconds on modern hardware.

05
UUIDs vs Sequential IDs

UUID v4 prevents enumeration attacks (users cannot guess adjacent IDs) and makes multi-database merges trivial. The storage cost is ~22 bytes vs 4 bytes for int — worth it.