StackPractices

Diff Checker

Compare two versions of text, code or configuration and see exactly what changed, down to the word inside each line. Unlike most online diff tools, nothing is uploaded anywhere: the comparison runs entirely in your browser, and share links redact secrets by default.

1. Paste the two versions

The diff updates automatically as you type. You can also drop a file onto either editor. Nothing is uploaded, logged or stored.

2. Tune the comparison

3. Differences

    Unified patch

    Standard unified diff format, compatible with git apply and patch.

    Share this comparison

    The link carries the texts in its hash fragment, which browsers do not send to servers. Detected secrets are redacted unless you opt in to exact sharing.

    Why compare text in a privacy-first diff tool?

    Most people who search for a diff checker are about to paste something they should not hand to a random server: nginx configs with internal hostnames, .env files, SQL migrations, API responses carrying tokens, or proprietary source code. Popular online diff tools process or store that content server-side, sometimes behind a paywall that gates basic features like sharing or export. This tool takes the opposite approach: the diff is computed locally in your browser with a linear-space LCS algorithm, there are no accounts, no upload endpoints and no usage limits, and the page ships without analytics or advertising scripts.

    What makes this diff checker different

    • Word-level emphasis inside modified lines. When a line changes, the exact words that were added or removed are highlighted, instead of marking the whole line as changed.
    • Real comparison options. Ignore case, trim or fully ignore whitespace, and skip blank lines — essential when comparing reformatted code or copied configuration files.
    • Unified and side-by-side views. Unified view reads like git output; side-by-side aligns both versions for visual scanning.
    • Patch export that actually applies. The unified diff output follows the standard format accepted by git apply, so you can move changes from the browser into a terminal.
    • Secret-safe sharing. JWTs, API keys, bearer tokens, private keys and password fields are detected automatically, flagged with a warning, and redacted in share links unless you explicitly opt out.

    Common use cases

    • Comparing two versions of a configuration file before deploying it.
    • Checking what changed between two API responses or log excerpts during incident debugging.
    • Reviewing a colleague's pasted code edit without creating a branch or pull request.
    • Verifying that a migration, schema or generated file matches what was expected.
    • Comparing prose revisions word by word in documentation or copy.

    For structured JSON comparison with semantic key ordering, use the JSON Formatter and Diff tool. If you are debugging tokens pasted into headers, the JWT Decoder inspects them locally as well.

    Frequently asked questions

    How do I compare two texts online?

    Paste the original text in the left editor and the modified version in the right one. The diff updates as you type, highlighting added lines in green, removed lines in red and modified lines with word-level emphasis so you can see exactly what changed inside each line.

    Does this diff checker upload my text to a server?

    No. The comparison runs entirely in your browser with JavaScript using a linear-space LCS diff algorithm. Nothing is sent to any server, logged or stored. The page is configured without analytics or advertising scripts, which matters when comparing configuration files, environment files or proprietary code.

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

    Line mode compares the texts line by line, which is ideal for code, configuration files and documents. Word mode tokenizes the input into words and shows exactly which words were added or removed, useful for prose. Character mode compares individual characters and works best for short strings such as tokens, identifiers or small snippets.

    How do I ignore whitespace or case differences?

    Enable the comparison options above the diff output. You can trim leading and trailing whitespace, ignore all whitespace entirely, ignore blank lines or make the comparison case-insensitive. The original text is always displayed unchanged; the options only affect how lines are matched.

    Can I export the diff as a patch file?

    Yes. The unified diff panel produces standard patch format with hunk headers that tools like git apply and patch understand. This is useful for sharing changes with teammates or applying them in a terminal without copying whole files.

    Is it safe to compare files that contain secrets?

    The comparison itself is safe because nothing leaves your browser, but sharing output needs care. The tool detects common secret shapes such as JWTs, API keys, bearer tokens, private keys and password fields, warns you, and redacts them in share links by default. Including the exact text requires an explicit opt-in.

    Why use a diff checker instead of git diff?

    git diff requires a repository or files on disk and a terminal. A browser diff checker is faster for quick comparisons: pasted API responses, two versions of a config file, SQL schemas, error logs or text someone sent you. For repository work, the exported patch here is compatible with git apply.