nTropi
Tutorial·

Using the JSON Formatter to Debug API Responses

Learn how to use the JSON Formatter tool to quickly inspect, validate, and navigate API responses.

The Problem

Raw API responses are a single line of minified JSON. Reading them in a terminal or browser DevTools is painful for complex nested structures.

Step 1: Copy the Raw Response

In DevTools → Network tab, right-click a request → Copy → Copy Response. Or copy from your terminal output.

Step 2: Paste Into the Formatter

Open /tools/json-formatter and paste your JSON.

Step 3: Read the Output

The formatter:

  • Adds indentation (2 or 4 spaces, your choice)
  • Colors keys, strings, numbers, booleans, and nulls differently
  • Shows line count and character count
  • Highlights the error line if JSON is invalid

Step 4: Validate

If the input is invalid JSON, the tool shows the exact parse error and position:

SyntaxError: Unexpected token } at position 142

Bonus: Minify

Switch to Minify mode to compact JSON for storage or transmission.