Compare JSON & YAML

Find meaningful differences between JSON or YAML structures.

  • Processed locally in your browser
  • Your documents stay in your browser
  • Nothing you enter is sent to a server

Processed locally

Both documents are read and compared in this browser tab. Nothing you enter is sent to a server.

Original

Auto-detected: JSON

Ready to compare.

Up to 200 kB, as UTF-8 text.

Changed

Auto-detected: YAML

Ready to compare.

Up to 200 kB, as UTF-8 text.

Checking this side…

Comparison result

No comparison yet

Add a document on each side, then choose Compare structures. The differences appear here.

How this comparison works

  • Compares structure and values, not formatting.
  • Key order in objects and mappings is ignored.
  • Whitespace, indentation, quoting and YAML comments are ignored.
  • Types stay significant: 1 and "1" are different.
  • List order stays significant: items are matched by position.
  • Numbers are compared by exact value: 1, 1.0 and 1e0 are equal.

Example

JSON
{
  "name": "api",
  "port": 3000,
  "debug": false
}
YAML
name: api
port: 8080
debug: false

The format does not matter. Only $.port is reported, as Changed.

Important limitations

  • Lists are compared by position. Nothing is matched by content, so moves and renames are not detected: a renamed key is one removal and one addition.
  • A missing key and a key set to null are different.
  • Differences are listed in path order, with keys in alphabetical order. They are not marked in your text.
  • Each side is one document of up to 200 kB, 80,000 values and 200 levels, counting every value an alias stands for. Larger input is refused, never partly compared.
  • YAML is read as data only, with at most 100 aliases per side. Merge keys, custom tags, several documents, keys that are not text and repeated keys are refused.
  • A repeated key in JSON is refused too, because tools disagree about which value wins.
  • Text that starts with { or [ and is not valid JSON is reported as invalid JSON. Open it as a .yaml or .yml file to read it as YAML.

Analytics only runs if you choose to allow it below. Advertising and affiliate tracking are not currently active on Numerila. Your preferences are saved in this browser, but these settings do not activate either service.