Skip to content
JSON

Data Types

The seven JSON value types.

By EZ4Code Team
data-typessyntax

Code

{
  "string": "hello",
  "number": 42,
  "float": 3.14,
  "boolean": true,
  "nullValue": null,
  "array": [1, 2, 3],
  "object": { "nested": "value" }
}

Explanation

JSON supports exactly seven value types: string, number, boolean, null, array, object, and the top-level document itself. Strings must use double quotes, and trailing commas are not permitted. Numbers cannot be NaN or Infinity, and keys must always be strings.

More JSON Snippets