Simple online tools for developers, networking, text and conversions.

Developer Tools

JSON Formatter Examples

Review practical JSON Formatter examples so you can understand expected input, output, and common patterns faster.

Why examples matter for JSON Formatter

Use this free JSON Formatter to format JSON online, beautify minified JSON, and pretty print complex objects instantly. It is useful for API responses, webhook payloads, application logs, configuration files, exported JSON data, and frontend or backend debugging. Paste raw or compact JSON to make it readable, inspect nested objects and arrays, and catch invalid syntax before using the data in your app, script, request, or documentation.

Example pages are especially useful for developer tools because they show what good input looks like, what kind of output to expect, and how the tool behaves in common scenarios.

JSON Formatter examples

Format a simple minified JSON object

Input

{"name":"John","age":30}

Output

{
  "name": "John",
  "age": 30
}

Useful when you copy compact JSON from an API response or script and want to read it quickly.

Beautify a nested API response

Input

{"status":200,"data":{"user":{"id":17,"name":"Anna"},"roles":["admin","editor"]}}

Output

{
  "status": 200,
  "data": {
    "user": {
      "id": 17,
      "name": "Anna"
    },
    "roles": [
      "admin",
      "editor"
    ]
  }
}

Makes nested API payloads much easier to inspect during backend or frontend debugging.

Format JSON with arrays of objects

Input

{"items":[{"id":1,"name":"Pen"},{"id":2,"name":"Book"}]}

Output

{
  "items": [
    {
      "id": 1,
      "name": "Pen"
    },
    {
      "id": 2,
      "name": "Book"
    }
  ]
}

Helpful when reviewing returned lists of products, records, tickets, or search results.

Format JSON log data

Input

{"event":"login","success":true,"ip":"192.168.1.10","meta":{"browser":"Chrome","device":"Desktop"}}

Output

{
  "event": "login",
  "success": true,
  "ip": "192.168.1.10",
  "meta": {
    "browser": "Chrome",
    "device": "Desktop"
  }
}

Useful for reading JSON logs copied from monitoring tools, browser consoles, or server output.

Format a webhook payload

Input

{"type":"payment.succeeded","data":{"id":"pay_123","amount":4999,"currency":"USD"}}

Output

{
  "type": "payment.succeeded",
  "data": {
    "id": "pay_123",
    "amount": 4999,
    "currency": "USD"
  }
}

Helpful when testing third-party webhooks and checking field names, event types, and payload structure.

Format a configuration object

Input

{"env":"production","features":{"cache":true,"debug":false},"ports":[3000,3001]}

Output

{
  "env": "production",
  "features": {
    "cache": true,
    "debug": false
  },
  "ports": [
    3000,
    3001
  ]
}

Useful when reading app settings, feature flags, or exported configuration blocks.

Format a deeply nested JSON structure

Input

{"company":{"name":"Acme","departments":[{"name":"Engineering","teams":[{"name":"Platform","members":12}]}]}}

Output

{
  "company": {
    "name": "Acme",
    "departments": [
      {
        "name": "Engineering",
        "teams": [
          {
            "name": "Platform",
            "members": 12
          }
        ]
      }
    ]
  }
}

Useful when nested data becomes difficult to read in one-line JSON output.

Format exported application data

Input

{"users":[{"id":1,"email":"a@example.com"},{"id":2,"email":"b@example.com"}],"total":2}

Output

{
  "users": [
    {
      "id": 1,
      "email": "a@example.com"
    },
    {
      "id": 2,
      "email": "b@example.com"
    }
  ],
  "total": 2
}

Useful for checking exported data before converting it to another format.

Detect invalid JSON with a trailing comma

Input

{"name":"John",}

Output

Invalid JSON

Trailing commas are not valid in JSON and should be removed before formatting.

Detect invalid JSON with unquoted keys

Input

{name:"John"}

Output

Invalid JSON

JSON keys must use double quotes, unlike some JavaScript object literals.

Format a deeply nested JSON structure

Input

{"company":{"name":"Acme","departments":[{"name":"Engineering","teams":[{"name":"Platform","members":12}]}]}}

Output

{
  "company": {
    "name": "Acme",
    "departments": [
      {
        "name": "Engineering",
        "teams": [
          {
            "name": "Platform",
            "members": 12
          }
        ]
      }
    ]
  }
}

Useful when nested data becomes difficult to read in one-line JSON output.

Format exported application data

Input

{"users":[{"id":1,"email":"a@example.com"},{"id":2,"email":"b@example.com"}],"total":2}

Output

{
  "users": [
    {
      "id": 1,
      "email": "a@example.com"
    },
    {
      "id": 2,
      "email": "b@example.com"
    }
  ],
  "total": 2
}

Useful for checking exported data before converting it to another format.

How to use these examples

  1. Paste valid or raw JSON into the input box
  2. Click Run Tool to format and beautify the payload
  3. Review the formatted output with indentation and line breaks
  4. If the input is invalid, fix the JSON syntax and run the tool again
  5. Copy the formatted result for debugging, validation, sharing, or reuse

Common mistakes in sample input

Trailing commas break JSON parsing

Fix: Remove the last comma after the final key-value pair in an object or array.

Object keys are not wrapped in double quotes

Fix: Make sure every JSON key uses double quotes, for example "name" instead of name.

Single quotes are used instead of double quotes

Fix: Replace single quotes with double quotes for JSON keys and string values.

Missing or mismatched brackets

Fix: Check every opening brace and bracket to make sure it has a matching closing character.

Only part of the JSON payload was pasted

Fix: Copy the full object or array so the formatter can parse the complete structure.

Next steps

After reviewing these examples, run the live tool with your own input. If your task involves a follow-up step, the related page can help you move to the next tool in the workflow.

Run the main tool

Open the main JSON Formatter page and test your own real input.

Open JSON Formatter