JSON Formatter for Developers: Debug API Responses Fast

JSON Formatter for Developers: Debug API Responses Fast

By Hami Tech·July 14, 2026·Updated September 10, 2026·3 min read

API responses arrive as one line. Logs wrap them. Support tickets paste them with smart quotes. Your job is to see the shape, confirm it is legal JSON, and find whether the 400 is your payload or theirs. That is a different task from "what is JSON". This guide is the debugging loop.

The JSON Formatter pretty-prints, validates and minifies locally. Access tokens in a body should never go to a random beautifier with a server behind it.

A fast debug loop

  1. Copy the raw body from DevTools, a gateway log or a failing unit test fixture.
  2. Paste into the formatter. If it is invalid, read the error position, then look at the line above it. Trailing commas and smart quotes from Slack live there.
  3. Collapse the tree to the object you care about: data.items[3], error.details, the nested user.
  4. If you need to ship the same data, minify before putting it back in a fixture or header playground. Whitespace is not the bug, but it is noise in a diff.

What usually breaks "valid-looking" JSON

  • Trailing commas after the last property. Legal in JS objects, illegal in JSON.
  • Single quotes. JSON keys and strings are double quotes only.
  • Comments someone left in a "JSON" config. Use JSONC in the editor, not in the wire format.
  • undefined, NaN or Infinity dumped from JavaScript. They are not JSON values.
  • A UTF-8 BOM or a callback( wrapper from JSONP.

For a slower primer on the format itself, see how to format, validate and minify JSON.

Frequently asked questions

Why is the API JSON invalid in the formatter but "works" in JavaScript?

You are probably looking at a JS object literal, not JSON. Unquoted keys and trailing commas will parse in JS and fail here, correctly.

Is the payload uploaded?

No. Parsing runs in your browser.

Should I minify before sending to production?

Only if size matters on that channel. Invalid JSON will still be invalid when minified. Validate first.

Open the JSON Formatter and paste the failing body. Free, no signup.