---
title: JSON Data Types
description: "> ## Valid Data Types > > > > In JSON, values must be one of the following data types: > > > > - a string > - a number > - an object (JSON object) > - an…"
url: "https://apprentice.mn/docs/json-data-types/"
updated: "2021-05-19"
category: Javascript
---

# JSON Data Types

> ## Valid Data Types
>
>
>
> In JSON, values must be one of the following data types:
>
>
>
> - a string
> - a number
> - an object (JSON object)
> - an array
> - a boolean
> - *null*
>
>
>
>  
>
>
>
> JSON values **cannot **be one of the following data types:
>
>
>
> - a function
> - a date
> - *undefined*

## JSON Strings

Strings in JSON must be written in double quotes.

### Example

              `{ "name":"John" }`

## JSON Numbers

Numbers in JSON must be an integer or a floating point.

### Example

      `{ "age":30 }`

## JSON Objects

Values in JSON can be objects.

### Example

              `{
"employee":{ "name":"John", "age":30, "city":"New York" }
}`

Objects as values in JSON must follow the same rules as JSON objects.

## JSON Arrays

Values in JSON can be arrays.

### Example

      `{
"employees":[ "John", "Anna", "Peter" ]
}`

## JSON Booleans

Values in JSON can be true/false.

### Example

      `{ "sale":true }`

## JSON null

Values in JSON can be null.

### Example

      `{ "middlename":null }`        [https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fapprentice.mn%2Fdocs%2Fjson-data-types%2F&linkname=JSON%20Data%20Types](https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fapprentice.mn%2Fdocs%2Fjson-data-types%2F&linkname=JSON%20Data%20Types)[https://www.addtoany.com/add_to/mastodon?linkurl=https%3A%2F%2Fapprentice.mn%2Fdocs%2Fjson-data-types%2F&linkname=JSON%20Data%20Types](https://www.addtoany.com/add_to/mastodon?linkurl=https%3A%2F%2Fapprentice.mn%2Fdocs%2Fjson-data-types%2F&linkname=JSON%20Data%20Types)[https://www.addtoany.com/add_to/email?linkurl=https%3A%2F%2Fapprentice.mn%2Fdocs%2Fjson-data-types%2F&linkname=JSON%20Data%20Types](https://www.addtoany.com/add_to/email?linkurl=https%3A%2F%2Fapprentice.mn%2Fdocs%2Fjson-data-types%2F&linkname=JSON%20Data%20Types)[https://www.addtoany.com/share](https://www.addtoany.com/share)
