The JSON test suite that certifies Fast JSON Viewer
Every release runs against 124 hand-built fixtures — well-formed files that must parse and malformed files that must be rejected at the exact failing byte. Here is the complete list, with the small files shown inline and linked to the spec each one probes.
Why a test suite?
JSON looks trivial, but the grammar in RFC 8259 / ECMA-404 has corners that real parsers get wrong: a leading zero (01) is illegal, -0 is legal, a bare .5 is not a number, lone surrogate escapes are malformed, and comments do not exist. Nicolas Seriot catalogued how badly parsers diverge on these in “Parsing JSON is a Minefield” and the companion JSONTestSuite. Fast JSON Viewer keeps its own fixtures in the same spirit.
The contract is simple. Files named pass-* are valid JSON and the viewer must accept them. Files named fail-* are malformed and the viewer must reject them, reporting the byte offset of the first error. The same fixtures drive the Node CLI validator and the Playwright end-to-end suite, and the page below is the browser-facing version you can click through live.
#jsonString=…, which loads those exact bytes straight into the viewer — so you can watch a pass- file render or a fail- file get flagged. The RFC 8259 §N tag on each entry jumps to the clause of the spec it exercises.Valid (must accept) Invalid (must reject) Performance Manifests
Valid JSON — parser must accept (45)
Every file here is well-formed JSON. The viewer must parse it without error and render it. Each filename is a link that opens the exact bytes live in the viewer.
-
All single-char escapes packed into one array element. RFC 8259 §7 Strings
["\"\\\/\b\f\n\r\t"] -
String containing every printable ASCII character (0x20..0x7E). RFC 8259 §7 Strings
[" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"] -
Top-level false literal. RFC 8259 §3 Values
false -
Top-level negative integer (-42). RFC 8259 §6 Numbers
-42 -
Top-level negative zero (-0) — distinct token, same value as 0. RFC 8259 §6 Numbers
-0 -
Top-level null literal. RFC 8259 §3 Values
null -
Top-level positive integer (42). RFC 8259 §6 Numbers
42 -
Top-level string — RFC 8259 allows any value at the root. RFC 8259 §7 Strings
"A JSON payload should be an object or array, not a string." -
Top-level true literal. RFC 8259 §3 Values
true -
Top-level integer 0 — smallest possible JSON. RFC 8259 §6 Numbers
0 -
30 levels of alternating object/array nesting — depth stress test. RFC 8259
{"level_1":[{"level_2":[{"level_3":[{"level_4":[{"level_5":[{"level_6":[{"level_7":[{"level_8":[{"level_9":[{"level_10":[{"level_11":[{"level_12":[{"level_13":[{"level_14":[{"level_15":[{"level_16":[{"level_17":[{"level_18":[{"level_19":[{"level_20":[{"level_21":[{"level_22":[{"level_23":[{"level_24":[{"level_25":[{"level_26":[{"level_27":[{"level_28":[{"level_29":[{"level_30":[{"leaf":true}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]} -
Duplicate object keys — RFC allows them; viewer keeps the last. RFC 8259 §4 Objects
{"dup": 1, "dup": 2} -
Empty array []. RFC 8259 §5 Arrays
[] -
Empty object {}. RFC 8259 §4 Objects
{} -
Object with an empty-string key — "" is a valid key. RFC 8259 §7 Strings
{"": "empty string key is valid"} -
Empty string used as key, value, and array element. RFC 8259 §7 Strings
{"":"empty key","nonempty":"","arr":["",""]} -
Object key containing every escape — keys are strings too. RFC 8259 §7 Strings
{"\"\\\/\b\f\n\r\t":"every escape in a key"} -
Exponent sign cross-product: 1e0, 1e+0, 1e-0, 1E0, etc. RFC 8259 §6 Numbers
[1e0, 1e+0, 1e-0, 1E0, 1E+0, 1E-0, 1.5e10, 1.5e+10, 1.5E-10] -
Numbers at the IEEE-754 boundary: 1e-300, 1e+300, 5e-324. RFC 8259 §6 Numbers
[1e-300, 1e+300, 5e-324] -
Five nested arrays with primitives at every level. RFC 8259 §5 Arrays
[1,[2,[3,[4,[5,[6,7,8,9,10]]]]]] -
Object alternating null / true / false values. RFC 8259 §3 Values
{"a":null,"b":true,"c":false,"d":null,"e":true,"f":false} -
Classic json.org "pass1" suite — numbers, escapes, whitespace, nesting in one document. RFC 8259
-
A JSON document embedded as a string inside another JSON document. RFC 8259 §7 Strings
{"payload":"{\"nested\":[1,2,\"hi\"]}","raw":"a\\b\\c"} -
Array of 100 small integers — tests dense numeric arrays. RFC 8259 §5 Arrays
[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99] -
Object with 50 keys — exercises object-member iteration. RFC 8259 §4 Objects
{ "k000": "v0", "k001": "v1", "k002": "v2", "k003": "v3", "k004": "v4", "k005": "v5", "k006": "v6", "k007": "v7", "k008": "v8", "k009": "v9", "k010": "v10", "k011": "v11", "k012": "v12", "k013": "v13", "k014": "v14", "k015": "v15", "k016": "v16", "k017": "v17", "k018": "v18", "k019": "v19", "k020": "v20", "k021": "v21", "k022": "v22", "k023": "v23", "k024": "v24", "k025": "v25", "k026": "v26", "k027": "v27", "k028": "v28", "k029": "v29", "k030": "v30", "k031": "v31", "k032": "v32", "k033": "v33", "k034": "v34", "k035": "v35", "k036": "v36", "k037": "v37", "k038": "v38", "k039": "v39", "k040": "v40", "k041": "v41", "k042": "v42", "k043": "v43", "k044": "v44", "k045": "v45", "k046": "v46", "k047": "v47", "k048": "v48", "k049": "v49" } -
Hex digits in \uXXXX are case-insensitive — \u00e9 vs \u00E9. RFC 8259 §7 Strings
["\u00e9 vs \u00E9","\uABCD\uabcd","\uFFFD \ufffd"] -
CRLF + tab + LF whitespace interleaved between tokens. RFC 8259 §2 Grammar
{ "a" : 1 , "b" : [ 1, 2 ] } -
Object whose values cover string, number, null, bool, array — common shape. RFC 8259 §4 Objects
{ "key1": { "key2": "string a", "key3": "string b" }, "key4": [1,22,null,false, true,"hello"] } -
pass-multilingual-100kb.json100.1 KB
~100 KB of repeated multilingual records — tests the chunked path on a non-trivial size. RFC 8259
-
Several spellings of negative zero: -0, -0.0, -0e0. RFC 8259 §6 Numbers
[-0, -0.0, 0, 0.0, -0e0] -
19 levels of nested arrays wrapping a single string. RFC 8259 §5 Arrays
[[[[[[[[[[[[[[[[[[["Not too deep"]]]]]]]]]]]]]]]]]]] -
20 levels of nested arrays — historically rejected by depth-limited parsers; RFC permits it. RFC 8259 §5 Arrays
[[[[[[[[[[[[[[[[[[[["Too deep"]]]]]]]]]]]]]]]]]]]] -
String containing \u0000 — the NUL character. RFC 8259 §7 Strings
"\u0000" -
Mixed integer, decimal, signed-zero and scientific forms. RFC 8259 §6 Numbers
[0, -0, 1, -1, 0.5, -0.5, 1e10, 1E10, 1e+10, 1e-10, 1.5e2, 1.7976931348623157e+308] -
Number.MAX_SAFE_INTEGER, MIN_SAFE_INTEGER and EPSILON. RFC 8259 §6 Numbers
{ "maxSafe": 9007199254740991, "minSafe": -9007199254740991, "epsilon": 2.220446049250313e-16 } -
Pretty-printed object with one nested object — classic json.org pass3. RFC 8259 §4 Objects
{ "JSON Test Pattern pass3": { "The outermost value": "must be an object or array.", "In this test": "It is an object." } } -
Pi to 22 significant digits — precision beyond IEEE-754 double. RFC 8259 §6 Numbers
3.14159265358979323846 -
String containing every single-char escape: \b \f \n \r \t \" \\ \/. RFC 8259 §7 Strings
["\b\f\n\r\t\"\\\/"] -
Surrogate-pair escape for emoji alongside BMP escapes. RFC 8259 §7 Strings
["\uD83D\uDE00 \u00e9 \u4e2d\u6587"] -
Tab and newline characters between tokens — all four JSON whitespace chars. RFC 8259 §7 Strings
{ "tab-indented" : "tabs as whitespace between tokens", "newline-separated" : "value on next line", "mixed" : [ 1 , 2 , 3 ] } -
BMP escapes plus an emoji surrogate pair (\uD83D\uDE00). RFC 8259 §7 Strings
["\uD83D\uDE00", "\u00e9", "\u4e2d\u6587", "\uD83C\uDF0D"] -
Raw 4-byte UTF-8 sequences (emoji) mixed with multi-script text. RFC 8259 §7 Strings
{"emoji":"😀🌍","cjk":"中文","cyrillic":"Привет","arabic":"مرحبا"} -
Raw UTF-8 for Japanese, Arabic, Chinese plus emoji — no escapes. RFC 8259 §7 Strings
{"unicode": "こんにちは、世界!🎉", "arabic": "مرحبا بالعالم", "chinese": "中文测试", "emoji": "🌍🌎🌏🎊"} -
250-digit mantissa — parser must not truncate. RFC 8259 §6 Numbers
[3.1415926535141592653514159265351415926535141592653514159265351415926535141592653514159265351415926535141592653514159265351415926535141592653514159265351415926535141592653514159265351415926535141592653514159265351415926535141592653514159265351415926535e0] -
Zero in many scientific forms: 0e0, 0e+1, 0e-1, 0.0e0. RFC 8259 §6 Numbers
[0, 0.0, 0e0, 0e+1, 0e-1, 0.0e0]
Invalid JSON — parser must reject (74)
Every file here is malformed on purpose. The viewer must reject it and report the byte offset of the first problem — accepting any of these would be a conformance bug. Open any link to watch the validator flag it.
-
Arithmetic expression (1 + 2) used as a value. RFC 8259 §6 Numbers
{"Illegal expression": 1 + 2} -
Array used as an object key. RFC 8259 §4 Objects
{[]:1} -
Invalid \a escape — only \b \f \n \r \t \" \\ \/ \u allowed. RFC 8259 §7 Strings
["\a"] -
Backslash followed by a space — not a defined escape. RFC 8259 §7 Strings
["tab\ character\ in\ string\ "] -
String wrapped in backticks — JSON only allows double quotes. RFC 8259 §7 Strings
[`a`] -
Minus sign alone, with no digits — [-]. RFC 8259 §6 Numbers
[-] -
C-style /* */ block comment — JSON has no comments. RFC 8259 §2 Grammar
/* block comment */ -
JSON literals are case-sensitive — "True" is not valid. RFC 8259 §3 Values
[True] -
Array element followed by colon — colon is for objects only. RFC 8259 §4 Objects
["Colon instead of comma": false] -
Trailing comma after the closing array bracket. RFC 8259 §5 Arrays
["Comma after the close"], -
Object member that uses comma where colon belongs. RFC 8259 §4 Objects
{"Comma instead of colon", null} -
Object member with two colons ("k"::v). RFC 8259 §4 Objects
{"Double colon":: null} -
Number containing two decimal points (1.0.0). RFC 8259 §6 Numbers
[1.0.0] -
Number containing two exponent markers (1e1e1). RFC 8259 §6 Numbers
[1e1e1] -
Exponent with two signs (0e+-1). RFC 8259 §6 Numbers
[0e+-1] -
Number with two minus signs (--1). RFC 8259 §6 Numbers
[--1] -
Two commas in a row — element omitted between them. RFC 8259
["double extra comma",,] -
Number with exponent marker followed by no digits inside an array. RFC 8259 §6 Numbers
[1e] -
Number with exponent marker but no exponent digits (0e). RFC 8259 §6 Numbers
[0e] -
Number with decimal point but no fraction digits before the exponent (1.e5). RFC 8259 §6 Numbers
[1.e5] -
Empty file — no JSON value present. RFC 8259
(empty file — zero bytes) -
Number with an exponent sign but no digits (0e+). RFC 8259 §6 Numbers
[0e+] -
Backslash followed by a literal newline — not a valid escape. RFC 8259 §7 Strings
["line\ break"] -
Array followed by an extra ]. RFC 8259 §5 Arrays
["Extra close"]] -
Object followed by another value after the closing brace. RFC 8259 §4 Objects
{"Extra value after close": true} "misplaced quoted value" -
JavaScript-style function call as a value. RFC 8259
{"Illegal invocation": alert()} -
# character where a value is expected. RFC 8259
[#] -
Hex literal 0x14 — not a JSON number. RFC 8259 §6 Numbers
{"Numbers cannot be hex": 0x14} -
Infinity literal — JSON has no infinity. RFC 8259 §6 Numbers
Infinity -
Integer used as an object key. RFC 8259 §6 Numbers
{1:2} -
Comma at the start of an array — implies missing first element. RFC 8259 §5 Arrays
[ , "<-- missing value"] -
Comma at the start of an object — implies missing first member. RFC 8259 §4 Objects
{,"k":1} -
Number with a leading + sign — JSON allows only - or none. RFC 8259 §6 Numbers
+1 -
C++-style // line comment — JSON has no comments. RFC 8259 §2 Grammar
// line comment [1,2,3] -
Minus sign separated from its digit by a space — [- 1]. RFC 8259 §6 Numbers
[- 1] -
Opens with [ but closes with } — bracket mismatch. RFC 8259 §4 Objects
["mismatch"} -
Object with two quoted strings adjacent and no colon. RFC 8259 §7 Strings
{"key" "value"} -
Object member without the : separating key and value. RFC 8259 §4 Objects
{"Missing colon" null} -
Two array values with no comma between them ("[1 2]"). RFC 8259 §5 Arrays
[1 2] -
Object member with key + colon but no value. RFC 8259 §4 Objects
{"k":} -
Multi-digit integer starting with zero (00) — disallowed by RFC. RFC 8259 §6 Numbers
00 -
Large (~100 KB) multilingual record set with a deliberate syntax error. RFC 8259
-
Bare identifier following backslash inside array (\naked). RFC 8259 §7 Strings
[\naked] -
NaN literal — JSON has no NaN. RFC 8259 §6 Numbers
NaN -
\uXXXX with a non-hex character (G). RFC 8259 §7 Strings
{"Bad unicode escape": "\u00G1"} -
Literal null used as an object key — keys must be strings. RFC 8259 §4 Objects
{null: "unquoted key"} -
Number starting with . instead of a digit (.5). RFC 8259 §6 Numbers
.5 -
Number ending in . with no fractional digits (1.). RFC 8259 §6 Numbers
1. -
Octal-style leading zero followed by more digits (013). RFC 8259 §6 Numbers
{"Numbers cannot have leading zeroes": 013} -
C-style \017 octal escape — not part of JSON. RFC 8259 §7 Strings
["Illegal backslash escape: \017"] -
Number prefixed with + inside an array ([+1]). RFC 8259 §6 Numbers
[+1] -
Python's None literal — JSON uses null. RFC 8259 §3 Values
[None] -
Literal control character (0x01) inside a string. RFC 8259 §7 Strings
[""] -
Literal newline (0x0A) inside a string — must be \n. RFC 8259 §7 Strings
["line break"] -
Literal tab (0x09) inside a string — must be \t. RFC 8259 §7 Strings
[" tab character in string "] -
String wrapped in ' instead of " — JSON requires double quotes. RFC 8259 §7 Strings
['single quote'] -
\u with exactly 3 hex digits before the closing quote. RFC 8259 §7 Strings
["\u123"] -
Trailing comma before the closing array bracket. RFC 8259 §5 Arrays
["extra comma",] -
Trailing comma before the closing object brace. RFC 8259 §4 Objects
{"Extra comma": true,} -
Valid array followed by stray non-whitespace ("[]x"). RFC 8259 §5 Arrays
[]x -
Valid object followed by stray non-whitespace ("{}x"). RFC 8259 §4 Objects
{}x -
\u escape with fewer than 4 hex digits ("\u12"). RFC 8259 §7 Strings
{"Truncated unicode escape": "\u12"} -
Two complete arrays at the root with no separator. RFC 8259 §5 Arrays
[][] -
Two complete objects at the root, separated by space. RFC 8259 §4 Objects
{} {} -
Array missing its closing ]. RFC 8259 §5 Arrays
["Unclosed array" -
Object with a trailing comma and no closing brace. RFC 8259 §4 Objects
{"Comma instead if closing brace": true, -
Object missing its closing }. RFC 8259 §4 Objects
{"Unclosed object": "value" -
String missing its closing quote (duplicate guard). RFC 8259 §7 Strings
{"Unclosed string": "no closing quote -
Underscore used as a digit group separator (1_000) — not JSON syntax. RFC 8259 §6 Numbers
[1_000] -
Unrecognised identifier "truth" used as a value. RFC 8259 §3 Values
["Bad value", truth] -
Object key without quotes — keys must always be strings. RFC 8259 §7 Strings
{unquoted_key: "keys must be quoted"} -
Uppercase \U escape — only lowercase \u is valid. RFC 8259 §7 Strings
["\U0041"] -
File that contains only whitespace. RFC 8259 §2 Grammar
-
Invalid \x.. escape — JSON has only \u, not \x. RFC 8259 §7 Strings
["Illegal backslash escape: \x15"]
Performance fixtures (1)
Large, real-world-shaped documents used to measure throughput rather than correctness. These are over 1 KB, so they are summarised rather than inlined.
-
Synthetic ~50 KB document — entry-level perf measurement. RFC 8259
Test suite manifests (4)
Aggregate manifests that bundle the individual fixtures above into runnable suites for the CLI and Playwright harness.
-
test-all.json5.1 KB
Master suite — every fixture, including large performance files. RFC 8259
-
test-normal.json4.7 KB
Functional-correctness suite — every pass-/fail- fixture, no large perf files. RFC 8259
-
test-perf.json565 B
Performance benchmark suite — large files only. RFC 8259
{ "suite": "perf", "description": "Performance benchmark suite — large files only, measures throughput not correctness", "files": [ "pass-perf-1mb-synthetic.json", "pass-perf-50kb-synthetic.json", "pass-perf-citm-catalog.json", "pass-perf-twitter-feed.json", "pass-perf-records-5mb.json", "pass-perf-10mb.json", "pass-perf-100mb.json", "pass-perf-205mb.json", "pass-perf-300mb.json", "pass-perf-400mb.json", "pass-perf-500mb.json", "pass-perf-600mb.json", "pass-perf-2gb.json", "fail-perf-100mb.json", "fail-perf-600mb.json" ] } -
test-quick.json860 B
Smoke test — one fixture per major category, <1 s total. RFC 8259
{ "suite": "quick", "description": "Minimal smoke test: one case per major category, target <1s total", "files": [ "pass-bare-null.json", "pass-bare-true.json", "pass-empty-array.json", "pass-empty-object.json", "pass-empty-string-key.json", "pass-string-escape-characters.json", "pass-number-formats.json", "pass-utf8-multilingual-and-emoji.json", "pass-deeply-nested-mixed-30.json", "pass-all-printable-ascii.json", "fail-unclosed-array.json", "fail-trailing-comma-in-array.json", "fail-octal-leading-zero-number.json", "fail-missing-colon-in-object.json", "fail-empty-exponent-zero.json", "fail-mismatched-array-object-brackets.json", "fail-empty-input.json", "fail-nan-literal.json", "fail-multi-digit-leading-zero.json", "fail-trailing-garbage-after-object.json" ] }
This is the static, readable companion to the interactive test suite. New to the format? Start with What is JSON? A simple JSON example.