DATA / FIELD GUIDE

Why does valid-looking JSON fail to parse?

Reproduce trailing commas, duplicate keys, and numeric precision traps.

The useful part

Passing syntax validation is only the first step. Check keys and precision too.

Separate JSON from JavaScript

JSON keys and strings use double quotes. The trailing comma below fails strict parsing, as do comments and single quotes. Run it in the validator, inspect the location, then remove the last comma.

INVALID JSON
{
  "name": "demo",
  "enabled": true,
}

PlainKit reports where parsing detects a problem. The cause may be on the previous line, such as a missing closing quote.

Valid syntax can still lose meaning

VALID SYNTAX / REVIEW REQUIRED
{
  "id": 9007199254740993,
  "role": "reader",
  "role": "admin"
}

This example has a large integer and a duplicate key. PlainKit formatting preserves numeric text and warns; conversion and comparison reject ambiguous inputs. A normal JavaScript parse-and-stringify round trip can change the identifier.

Agree on string representations for identifiers and exact integer amounts. Monetary values also need explicit units and decimal conventions; quoting them alone does not validate the business meaning.

JSON-RPC: hexadecimal quantities still need JSON strings

This authored offline exercise makes no node request. The first input uses a bare hexadecimal value and fails JSON syntax validation. Quoting it produces valid JSON. A separate API check is required to establish whether a node accepts a method and its parameters.

INVALID JSON / OFFLINE FIXTURE
{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":[0x1,true],"id":1}
VALID JSON / OFFLINE FIXTURE
{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["0x1",true],"id":1}

Validate each fixture here: expect a syntax location for the first and a valid result for the second. This establishes local parsing only, not a successful node response or any chain state. Ethereum JSON-RPC also distinguishes hexadecimal quantities from byte data; arbitrary strings are not necessarily valid parameters.

ABI: valid JSON does not establish the correct interface shape

A standalone ABI function object is valid JSON, but this site’s EVM decoder expects an array for a JSON ABI. Wrap the authored object below in square brackets, then supply matching calldata.

VALID JSON / WRONG DECODER SHAPE
{"type":"function","name":"transfer","inputs":[{"name":"to","type":"address"},{"name":"amount","type":"uint256"}],"outputs":[{"type":"bool"}],"stateMutability":"nonpayable"}
VALID JSON ABI ARRAY
[{"type":"function","name":"transfer","inputs":[{"name":"to","type":"address"},{"name":"amount","type":"uint256"}],"outputs":[{"type":"bool"}],"stateMutability":"nonpayable"}]

Offline checks: both inputs pass JSON syntax validation. The decoder rejects the object as invalid_abi; the array decodes matching transfer fixture data. Decoding does not prove real contract execution, balance changes, or transaction safety.

Treat each JSONL line as one record

JSONL
{"id":"001","status":"ready"}
{"id":"002","status":"queued"}
  • Select JSONL mode and keep each record on one line.
  • Fix failing lines, then review duplicate-key and precision warnings.
  • Validate the downloaded result again in the system that will consume it.

Sources & editorial note

Added sources and offline fixtures checked October 31, 2026. Examples ran locally, without node requests or transactions. AI-assisted editing with manual review. Sources checked October 17, 2026. Examples and practice notes are authored for PlainKit. Sources do not endorse this project; this is not an audit conclusion.

Try it for yourself.

Start with a synthetic fixture. Tool inputs stay in your browser.

Open the tool →Get the fixture ↓