JSON has six value types: object, array, string, number, boolean, and null. Correctly distinguishing them matters because APIs and applications may treat visually similar values very differently.
JSON describes data, not application-specific classes. Dates, binary files, large integers, and special numeric values need agreed representations between producer and consumer.
Objects and arrays
An object is a collection of string-named members enclosed by braces. An array is an ordered list enclosed by brackets. Objects suit records with named fields; arrays suit sequences or collections.
Member names must be double-quoted strings. Array position is significant, while software should generally not depend on the order in which object members appear. Both containers may nest any JSON value.
Strings
Strings are Unicode text enclosed in double quotes. Escape a double quote or backslash when it is part of the value, and represent control characters with escapes such as \n or \t.
A date such as "2026-07-24" is still a string to a JSON parser. The application must agree on the date format and timezone meaning. Base64-encoded binary data is also a string and needs separate decoding.
Numbers
JSON has one number grammar rather than separate integer and floating-point types. The receiving programming language decides how to store the value. JavaScript numbers cannot exactly represent every large integer, which matters for long database identifiers.
If an identifier is not used for arithmetic, a string may be safer. JSON does not represent NaN or positive and negative infinity; use a documented alternative such as null or a string only when the consumer expects it.
Booleans and null
The boolean values are true and false without quotes. "false" is a non-empty string and many languages treat it as truthy, so substituting a string can create subtle bugs.
null explicitly represents no value, but its business meaning is application-specific. It may mean unknown, intentionally empty, not applicable, or cleared. A missing property is structurally different from a property present with null.
Type checks during debugging
When an API behaves unexpectedly, compare both value and type. Check 42 versus "42", false versus "false", null versus a missing key, and [] versus {}. A structural comparison makes these differences clearer than a plain text scan.
Schema validation can formalize expected types, required fields, allowed values, and nesting. Syntax validation alone confirms that the document is JSON, not that its types fit a particular API contract.