Loading comparison...
Loading comparison...
An extension of JSON that allows comments, trailing commas, and unquoted keys. More human-friendly for configuration files.
Jordan Tucker created JSON5 in 2012 to address the friction developers experience when writing JSON by hand, extending the format with features borrowed from ECMAScript 5.1 syntax. JSON5 allows single-line and multi-line comments, trailing commas in objects and arrays, unquoted object keys that are valid identifiers, single-quoted strings, multi-line strings, hexadecimal numbers, leading and trailing decimal points, positive and negative Infinity, NaN, and explicit positive sign on numbers. These additions make JSON5 significantly more ergonomic for configuration files that humans read and edit frequently, while maintaining a clear upgrade path from standard JSON — every valid JSON document is also valid JSON5.
The format is used by several prominent development tools: Babel uses json5 for its configuration, and many VS Code extensions accept JSON5 configuration files. The json5 npm package provides a drop-in replacement for JSON.parse() and JSON.stringify(), and implementations exist for Python, Java, Go, Rust, and other languages. JSON5's tree structure mirrors JSON exactly — objects and arrays form a nested hierarchy — with the same data types plus the numeric extensions.
The specification is intentionally conservative, adding only features that ECMAScript 5.1 already supports for object and array literals, ensuring that the syntax is familiar to JavaScript developers. While JSON5 has not achieved the universal adoption of standard JSON, it occupies a valuable niche for configuration files where comments explain settings, trailing commas simplify diff-friendly editing, and human readability takes priority over strict machine parseability.
JSON5 configuration files often contain comments that explain why settings exist, making it important to track when both values and their documentation change simultaneously. Comparing JSON5 files catches modified configuration values alongside their explanatory comments, altered trailing comma patterns that affect parser compatibility, changed unquoted keys that may break consumers expecting standard JSON, and updated numeric formats that shift between decimal and hexadecimal representation.
Developers reviewing config changes need structural comparison that respects JSON5's hierarchy while preserving comment context.
UtraDiff parses JSON5 files into a semantic tree, preserving comment context while diffing the underlying data structure. It detects reordered keys as identical and ignores trailing commas and quoting style differences, focusing on actual value changes.
The structured tree view highlights added, removed, and modified entries alongside the text diff. Cross-format comparison lets you diff JSON5 against standard JSON, YAML, or TOML to verify that relaxed config files match their strict equivalents.
Supported extensions: .json5
JSON5 can be compared with: JSON, JSONL, YAML, TOML, INI, Environment, Properties