🇪🇸 Leer este comparador diff privado en español aquí
Pasting production .env secrets, Kubernetes YAML manifests, or customer JSON payloads into ad-heavy diff websites leaks sensitive configs to third-party servers. This 100% private browser diff checker runs a deterministic Longest Common Subsequence (LCS) line diff entirely in local memory—zero uploads—plus recursive JSON Key Normalization.
Exact Mathematical Basis (LCS Matrix & Canonical JSON)
To align modified blocks cleanly without false line shifts when lines are inserted or removed at the top, the tool computes the Longest Common Subsequence (LCS) recurrence over line arrays A[0..m] and B[0..n]:
LCS[i][j] = LCS[i-1][j-1] + 1 when A[i] == B[j]; otherwise max(LCS[i-1][j], LCS[i][j-1]).
Structural similarity is computed directly as:
Similarity (%) = (2 × Unchanged_Lines / (Lines_A + Lines_B)) × 100
When Canonicalize JSON is enabled, objects on both sides are parsed via JSON.parse and recursively re-serialized with alphabetically sorted keys so semantically identical API responses produce zero noise.
Official Standards & References
- IETF RFC 8259: The JavaScript Object Notation (JSON) Data Interchange Format
- GNU Diffutils Manual: Comparing and Merging Files
Engineering Diff Modes Comparison
| Use Case | Recommended Toggle | Practical Benefit |
|---|---|---|
| Reordered REST / GraphQL JSON | Canonicalize & sort JSON keys | Eliminates key-order false positives |
Production .env & API secrets | Default local browser diff | Zero third-party server logging |
| YAML / Nginx formatting tweaks | Ignore whitespace / blank lines | Highlights only real config deltas |
Frequently Asked Questions (FAQ)
Does any pasted code or secret leave my machine?
Never. JSON normalization and the LCS diff matrix run strictly inside local browser memory with zero network calls.
What happens if "Canonicalize JSON" is checked on YAML or plain logs?
It safely reports invalid JSON syntax above the viewer and falls back gracefully to normal line-by-line comparison.
Related Syncroma Tools: Private Cron, Regex & JSON Validator · Private JWT Decoder & HMAC Verifier · Private SHA-256 File Checksum Verifier