API response and XML formatter

An API response is the body a server returns to a request, usually as JSON or XML, which clients parse to read data and errors.

Format or minify XML and JSON API responses, and check validity, top-level keys, nesting depth and size. Free, and responses stay in your browser.

Browser-sideNo accountCopy, download, or print

Last reviewed

Your inputs are saved as a draft in this browser only. Nothing is uploaded.

Jump to result
Interactive workspace

Inputs

Result

More export options

Responsevalid JSON
Top-levelobject (3 keys)
Structure depth4
Total keys8
Characters140

Top-level keys

KeyType
dataarray (1)
metaobject
errorsarray (0)
{
  "data": [
    {
      "id": 101,
      "status": "active",
      "tags": [
        "api",
        "customer"
      ]
    }
  ],
  "meta": {
    "page": 1,
    "total": 1
  },
  "errors": []
}

How to use it

  1. Paste the API response and set the response format to JSON or XML.
  2. Choose an operation: format, minify, or analyze only.
  3. Set the indent size to control how the formatted output is indented.
  4. Review the structure metrics and formatted output, then copy or download it.

Questions

Can it format XML as well as JSON?
Yes. Set the response format to XML, or paste content that starts with a tag, and the tool reformats or minifies the tag structure. JSON responses get full parsing with your chosen indentation.
What happens if the response is invalid JSON?
The response is flagged as invalid and the parser's error message is shown, so you can locate and fix the problem.
Is my API response uploaded anywhere?
No. Formatting and analysis run entirely in your browser and nothing is uploaded.
When should I use this instead of the JSON formatter?
Use this tool for XML and SOAP responses, or when you want a quick summary of a JSON response: whether it is valid, its top-level keys and their types, and how deeply it is nested. For quick JSON formatting, validation, and key sorting, the JSON formatter is simpler.