JSON YAML Diff

Compare JSON and YAML values, types and ordered arrays.

About this tool

Paste JSON or YAML into A and B. Object key order, comments and formatting are ignored; arrays are compared by index. Adding an array element can therefore change later indices. Automatic mode accepts the YAML 1.2 core schema, which includes JSON. Select JSON to enforce JSON syntax. Empty input waits for a document; an explicit null is a value.

YAML flow collections, block text, quoted strings and ordinary nesting are supported. Duplicate keys, anchors, aliases, tags, merge keys, complex keys and YAML 1.1 directives are rejected rather than silently interpreted. Integers remain exact, including very large identifiers. Fractional and exponential numbers use JavaScript floating-point precision; this is not an arbitrary-precision decimal comparison. Nonfinite values are rejected.

Paths use dots for simple keys and quoted brackets for other keys; $ denotes the document root. A key named $ is shown as ["$"]. Each row shows addition, removal, value change or type change. An array and an object always differ in type. Copy and JSON download include all changes, with path arrays and exact integer tokens. The table shows 100 changes per page. Limits: 1 MiB of text per document, depth 80, 20,000 syntax nodes and 10,000 changes. Everything runs in this browser. Raw documents and their format choices are kept on this device through the shared browser store, including empty and invalid drafts. Comparison results and pagination are not saved. The processing limit is 1,048,576 UTF-16 code units per document (not UTF-8 bytes); drafts up to twice that size can be retained. If browser storage is full or blocked, the shared warning indicates that changes are only retained in memory.