{ }jsonkitOpen
JSON core and syntax

Key/value pair (member)

Also called member, name/value pair, property

A key/value pair, called a member in RFC 8259, is one entry in a JSON object: a double-quoted string key, a colon and any JSON value, like "email": "a@b.com". Keys can be any string, so field names with spaces, like "first name", are valid JSON. You read such keys with bracket notation, as in obj["first name"], and keys in one object should be unique.

In more detail

A key/value pair is one entry in a JSON object. RFC 8259 calls it a member. It is a key in double quotes, a colon and a value, such as "email": "ada@example.com". The value can be any JSON type, including another object or an array.

A key can be any string. Spaces, dashes, dots, emoji and an empty string are all valid JSON keys, as long as the key is in double quotes and special characters are escaped. So yes, JSON field names can have spaces.

Keys with spaces are harder to use in code. JavaScript needs bracket notation, obj["first name"], instead of dot notation, and JSONPath needs $['first name']. Many APIs stick to camelCase or snake_case for that reason.

Keys in one object should be unique. RFC 8259 does not forbid duplicates, but parsers handle them differently, and JavaScript keeps only the last value.

Example

Reading keys with spaces and dashesjs
const user = JSON.parse('{"first name": "Ada", "e-mail": "ada@example.com"}')

user["first name"]   // "Ada"
user["e-mail"]       // "ada@example.com"
// user.first name    // syntax error: dot notation cannot hold a space

Try it

Learn more in the guide JSON data types explained with examples.

← Back to Key/value pair (member) in the JSON glossaryUpdated 2026-10-01