Nested JSON Object Example

Nested JSON Object example with formatted output. Learn JSON syntax with practical examples.

Open JSON Formatter →

Nested JSON Object

Here's an example of a nested json object:

Minified

{"person":{"name":"John","address":{"city":"NYC"}}}

Formatted

{
  "person": {
    "name": "John",
    "address": {
      "city": "NYC"
    }
  }
}

JavaScript Usage

// Parse JSON
const data = JSON.parse('{"person":{"name":"John","address":{"city":"NYC"}}}');

// Stringify with formatting
JSON.stringify(data, null, 2);

Related Tools