DiffVaultTEXT TOOLKIT

Diff · Format · Validate — offline in your browser

Compare, format and validate text without sending it anywhere

Paste two versions of a text, a JSON document, a YAML file, a CSV table or a SQL query. DiffVault highlights every added, removed and changed line — down to the changed characters — and can hand you a unified patch. The same page formats and minifies JSON, normalises YAML, sorts and re-delimits CSV, reformats SQL, and validates JSON with an optional schema, reporting the exact line and column of each problem. No account, no upload, no server call: the work happens in this tab.

Modes Text · JSON · YAML · CSV · SQLDiff Line + character levelNetwork 0 requests from the tool

Compare

  • 0added
  • 0removed
  • 0changed

Paste text into both panes, or load a sample, to see the comparison.

Features

Everything on one page

Six things the tool does, all without a server.

DIFF

Line and character-level comparison

Added, removed and changed lines are marked in both panes; changed lines get a second, character-level highlight so a one-word edit is visible inside a long line.

VIEW

Side-by-side or unified

Switch between two aligned panes and a unified stream with @@ hunk headers. Both views come from the same diff, so the counts never disagree.

JSON

Semantic JSON comparison

With semantic mode on, both documents are parsed and re-serialised with sorted keys, so reordered properties or different indentation stop producing false differences.

FORMAT

Formatter and minifier

JSON with 2 or 4 spaces or minified, YAML re-indented and tidied, CSV sorted by column and converted between comma, tab, semicolon and pipe, SQL keywords upper-cased and clauses broken onto their own lines.

VALIDATE

Errors with line and column

JSON syntax errors point at the exact position. Add a JSON Schema to check required fields, types, numeric ranges, string lengths, patterns and array sizes; CSV checks every row against the header column count.

EXPORT

Patch download and copy

Download the comparison as a .diff patch with standard hunk headers, or copy it and the formatted result to the clipboard in one click.

How it works

Four steps, no setup

The tool is a single page; every step below happens on your device.

01

Choose a mode

Pick Text, JSON, YAML, CSV or SQL. The mode changes the options and the samples, not your data.

02

Paste both versions

Left is the original, right is the changed version, or load a sample pair to see the behaviour first.

03

Compare and adjust

Line-level marks appear immediately. Turn on ignore-whitespace, ignore-case or semantic JSON when formatting noise is not the point.

04

Take the result

Copy or download the unified patch, or move to the Format and Validate tabs for the same text.

Coverage

What each mode understands

One comparison engine, with format-aware extras per mode.

ModeCompareFormat / minifyValidate
TextLine and character diff, whitespace and case options——
JSONSemantic comparison with sorted keys, or raw text diffIndent 2, indent 4, minifySyntax with line/col, JSON Schema: required, type, range, length, pattern, enum, items
YAMLLine diff that can ignore indentation differencesRe-indent to 2 spaces, tidy colons, list markers and comments—
CSVRow and cell diffSort by column (A→Z, Z→A), convert delimiter: comma, tab, semicolon, pipeColumn count per row against the header, unclosed quotes
SQLStatement diffKeyword upper-casing, clause line breaks and indentation—

Formatting and validation are deliberately conservative: they tidy presentation and report what they can prove, and they never rewrite string literals or comments.

Under the hood

How the comparison is built

A longest-common-subsequence pass over lines, then a second pass over tokens inside changed lines.

The first pass compares lines by their longest common subsequence, after trimming the identical prefix and suffix. That produces the three states you see: unchanged, removed, added. A removed line immediately followed by an added line is paired as a change, so edits stay on one row instead of drifting apart.

The second pass looks inside each changed pair. It finds the common prefix and suffix of the two lines, then compares the remaining words and spaces, marking the characters that actually moved. This is why replacing one word in a long sentence highlights that word and not the whole line.

The optional ignore-whitespace and ignore-case settings only change the comparison key, never the text shown. Semantic JSON mode parses both sides and re-serialises them with sorted keys, which removes key order and indentation from the equation.

Line pass longest common subsequenceCharacter pass prefix / suffix + token LCSPatch unified hunks, 3 lines of contextLimits very large inputs fall back to index pairing and say so

Questions

Frequently asked

Is my text sent to a server?

No. The diff, the formatters and the validators are JavaScript in this page. There is no fetch call, no XHR and no beacon in the tool; you can confirm it in the network panel of your browser. Only the advertising script in the page head is loaded from outside.

Does DiffVault compare JSON semantically?

Yes, when semantic mode is on. Both documents are parsed, keys are sorted, and the result is compared as canonical JSON. If either side is not valid JSON the tool says so and falls back to a text diff instead of guessing.

What does the .diff download contain?

A unified patch: a --- and +++ header, then one or more hunks with @@ -start,count +start,count @@ lines and three lines of context. It is plain text, so it opens in any editor and applies with the usual patch tools. With semantic JSON on, the patch describes the canonicalised documents (keys sorted), not the raw files.

How exact are the validation positions?

JSON syntax errors come with a line and column from the parser. Schema errors point at the key of the offending value as it appears in your document, and each error also names the path, for example $.customer.age, so a shifted column can never hide the problem.

Is there a size limit?

The page has no server limit; the practical limit is your device's memory. Comparisons above roughly four million line pairs fall back to a simpler alignment and display the first 4,000 rows, with a notice that says so.

Can I use the output in a real commit?

The patch is standard unified diff text and can be applied with common tools, but treat the labels a/original and b/changed as placeholders and check the result before committing. The validators are practical checks, not a formal certification.

Honest limits

What this tool does not do

Not a YAML or SQL parser

YAML normalisation re-indents and tidies text; it does not resolve anchors, tags or multi-document streams. SQL formatting is a readable layout of keyword and clause structure, not a dialect-aware parse, so unusual syntax may be spaced oddly.

Schema support is the practical subset

Required, type, properties, items, enum, minimum, maximum, exclusive bounds, string lengths and pattern are checked. References, conditionals, allOf/anyOf/oneOf and custom formats are not.

No file upload or folder access

Text is pasted or typed. That keeps the tool offline, and it means very large files are better handled by a desktop diff.

Validation is not a guarantee

A document that passes here can still be rejected by an API with stricter rules, and formatting cannot repair invalid input. Always keep a copy of the original.

Standards the output follows

  • Unified diff — --- / +++ headers, @@ hunks, three lines of context
  • JSON — RFC 8259 syntax; JSON Schema keywords as listed above
  • CSV — RFC 4180 quoting for commas, quotes and line breaks
  • Privacy — no upload, no account, no analytics; settings stay in localStorage