Format API Response JSON

Pretty print an API response from curl, Postman or fetch. Paste the raw JSON body and read nested results, arrays and nulls clearly.

Part of the free JSON Formatter & Validator. Runs in your browser — nothing is uploaded.

Format API Response JSON

Raw responses from curl, browser dev tools and logs arrive as one dense line. Paste the body here to inspect nested objects, arrays and null fields. It is the fastest way to confirm an endpoint returned what the docs promised.

Worked example: Paginated API response, formatted

Raw response body

{"status":"ok","page":1,"results":[{"id":101,"name":"Ada","roles":["admin","dev"]},{"id":102,"name":"Linus","roles":["dev"]}],"next":null}

Readable response

{
  "status": "ok",
  "page": 1,
  "results": [
    {
      "id": 101,
      "name": "Ada",
      "roles": [
        "admin",
        "dev"
      ]
    },
    {
      "id": 102,
      "name": "Linus",
      "roles": [
        "dev"
      ]
    }
  ],
  "next": null
}

Practical tip

When piping from the terminal, copy only the body, not the HTTP headers. Use curl -s so progress output does not end up in the JSON you paste.

How to use this JSON Formatter

  1. 1Use the live tool above — it runs entirely in your browser and never uploads your data.
  2. 2Paste the sample from the worked example, or use your own input.
  3. 3Copy the result, then adapt the same steps in your editor, script, or pipeline.

Format API Response JSON FAQs

Can I format a very large API response?

Yes, within your browser memory limits. Responses of several megabytes format fine on a modern device, and the tree view helps you collapse sections you do not need.

What if the response is wrapped in text or HTML?

Remove anything outside the outermost braces or brackets first. If the server returned an HTML error page, the endpoint itself failed and there is no JSON to format.

More JSON Formatter pages

Open the full JSON Formatter tool →