Skip to content
All tools

Text Diff

Available

Compare text, code and configuration line by line locally with readable hunks and unified output.

Runs locally. Your compared text never leaves this browser.

Compare two texts

Paste text, source code or configuration. Options change comparison keys but never rewrite the displayed source.

Compare both sides to inspect changed lines.

Line-based comparison

Text Diff treats line order and textual content as meaningful instead of applying JSON-specific structural semantics.

Focused change hunks

Changed regions include nearby context and stable original/updated line numbers so code and configuration remain readable.

Browser-local by design

The diff engine runs entirely in this browser with explicit safety limits and no comparison payload sent to a Devary server.

Developer guide

Compare configuration edits and readable line-level changes

Text Diff uses a local line-level algorithm to group additions and removals into unified diff hunks. Learn when normalization changes what counts as a difference.

Practical workflow

  1. Configure

    Paste the original and updated versions in separate panels, keeping line breaks in place.

  2. Try it

    Run the comparison and inspect removed, added and unchanged lines before copying a unified diff.

  3. Check the result

    Adjust ignore-case or whitespace options cautiously; they can hide changes relevant to code or configuration.

Worked examples

One changed configuration value

The output contains a removal for mode=dev and an addition for mode=pro with surrounding context.

Example input

Original:
mode=dev
port=3000
Updated:
mode=pro
port=3000

Expected result

@@ -1,2 +1,2 @@
-mode=dev
+mode=pro
 port=3000

Ignore case and repeated whitespace

With both comparison options enabled, the two lines are considered equivalent even though their spelling differs.

Configuration

ignoreWhitespace=true; ignoreCase=true

Example input

Original: Hello  World
Updated: hello world

Expected result

{"added":0,"removed":0,"unchanged":1,"hunks":0}

Limits and safeguards

Supported scope

The V1 engine limits each side to 5,000 lines and 500,000 characters, with a bounded edit-distance budget.

Before using in production

Whitespace and case normalization can conceal meaningful differences. Always inspect raw versions before deployment.

Common question

Why does the unified diff show a removed and added line?

A line replacement is represented as one removal and one addition; this is normal unified diff notation.