.json

JSON test files

Records as deep and as strange as you need: big integers that lose precision, lone surrogates, duplicate keys, or JSON that is broken on purpose.

Or start from a preset

What is a JSON file?

Short answer

JSON is a text format for structured data: objects in braces, arrays in brackets, strings in double quotes, numbers, true, false and null. RFC 8259 defines it, and almost every API speaks it.

The grammar is small but the edges are sharp. JavaScript reads 9007199254740993 as 9007199254740992, duplicate keys are legal but ambiguous, and many parsers refuse a byte order mark or a trailing comma. These files let you see what your code does with each.

Anatomy of a JSON file

  • { }An object: "key": value pairs, keys are strings
  • [ ]An array of values
  • "\u00e9"Strings, with escapes for quotes, control characters and Unicode
  • 1.5e-10Numbers: no leading zeros, NaN or Infinity
  • null true falseThe three literals

What you can generate

  • Nesting depth from flat to 12 levels
  • nulls, empty arrays and empty objects
  • Unicode and escapes, including a lone surrogate
  • Big numbers: 2^53+1, int64 min, uint64 max
  • Floats and exponents, -0.0 and 0.1+0.2
  • Long strings and duplicate keys
  • Invalid on purpose: trailing comma, single quotes, unquoted keys, comments, NaN, truncated, BOM

How to make one

  1. Open the JSON generator, or start from a preset above.
  2. Set the size and switch on the edge cases you need; the preview and size estimate follow every change.
  3. Generate, then download. The file is made in your browser, and the same preset and seed always give you the same file.

Questions

Yes, unless you pick an invalid variant under Validity. Valid files parse with JSON.parse, Python's json module and other strict parsers.

JavaScript numbers are doubles, so integers above 2^53 lose precision. A file with 9007199254740993 shows whether your parser keeps the exact value.

It is a \ud800 escape with no partner. JSON allows it, but it is not valid Unicode, so some decoders reject it or replace it.

Yes, use the NDJSON format: one record per line, for log pipelines and streaming parsers.

Related formats