Skip to the content

Contact usFree tools · No signup · Files stay on your device

Developer Tools

How to read a minified JSON API response quickly

How to read a minified JSON API response quickly

A minified JSON response is the same data as a normal one, squeezed onto a single line with all the spaces removed. Computers love it. People cannot read it. The quickest fix is to paste it into the free JSON Formatter, which indents it, lets you fold and unfold the parts you do not need, and runs in your browser so the response stays on your device.

This guide shows the fastest routine for reading an API response, whether you are a developer debugging an endpoint, a tester checking a response or a student following a tutorial.

Why API responses arrive on one line

Every space, tab and line break in JSON costs bytes. Servers remove them so the response is smaller and quicker to send, and your programme does not care because it reads the data, not the layout. The result is a line like this:

{"status":"ok","page":1,"total":2,"data":[{"id":101,"customer":{"name":"Nusrat Jahan","phone":"01812345678"},"amount":1850.00,"currency":"BDT","tags":["paid","dhaka"]},{"id":102,"customer":{"name":"Imran Hossain","phone":"01912345678"},"amount":720,"currency":"BDT","tags":[]}]}

You can find the value you want if you squint for long enough, but there is a faster way.

Step 1: copy the response

Where you copy from depends on how you got the response.

  • Browser developer tools: press F12, open the Network tab, click the request, then open its Response tab and select all the text.
  • Postman, Insomnia or a similar client: copy from the raw body view.
  • Terminal: copy the output of your curl command.
  • A log file or database field: copy the whole JSON text, from the first { or [ to the last } or ].

Copy all of it. A response cut off in the middle is invalid and the formatter will tell you so.

Step 2: paste it into JSON Formatter

Open JSON Formatter and paste into the box labelled "Paste or type JSON". The result appears straight away, with a short pause of about 0.2 seconds after you stop typing. For a very large paste the pause is slightly longer, and a "Parsing…" label shows while it works.

You can also press Open file to load a saved .json or text file instead of pasting.

Step 3: beautify it

Under Output style, Beautify is selected by default, with an Indent of 2 spaces. Our example now reads:

{
  "status": "ok",
  "page": 1,
  "total": 2,
  "data": [
    {
      "id": 101,
      "customer": {
        "name": "Nusrat Jahan",
        "phone": "01812345678"
      },
      "amount": 1850,
      "currency": "BDT",
      "tags": [
        "paid",
        "dhaka"
      ]
    },
    {
      "id": 102,
      "customer": {
        "name": "Imran Hossain",
        "phone": "01912345678"
      },
      "amount": 720,
      "currency": "BDT",
      "tags": []
    }
  ]
}

Each key is on its own line and each nesting level is pushed to the right, so the shape is obvious: a wrapper with status, page and total, and a data list of two records.

Notice that 1850.00 became 1850. The formatter reads the data and prints it again, so numbers are written in their shortest form. The value is the same. If you need the exact original text, keep it.

Prefer a different style? Choose 4 spaces or Tabs from the Indent list.

Step 4: switch to Tree view for big responses

For anything longer than a screen, the tree is faster than scrolling. Under the output panel, the View switch has Text and Tree. Choose Tree.

You now see collapsible rows, each marked "object" or "array" with a count, such as {5 keys} or [2 items]. The tree opens two levels by default, so in our example you see status, page, total and data, and the two records folded as {5 keys}. Click the ▸ arrow beside a record to open it.

Two buttons help:

  • Expand all opens everything. On a very large response it opens as many levels as can be shown comfortably and tells you how many.
  • Collapse all folds it back to the top.

Arrays with more than 200 items show the first 200 and a button such as "Show 1,000 more (4,000 hidden)", so a list of thousands of records stays quick.

Step 5: find the value you need

A few habits make this fast:

  • Look at the top level first. The green note says what you have, such as "top level is an object with 4 keys". If you expected a list and see an object, that is your first clue.
  • Check the numbers under the panels. After a valid result you see Keys, Values (nodes) and Max depth. For our example that is 18 keys, 23 values and a depth of 4, which tells you how nested it is.
  • Sort keys when hunting. Tick Sort keys A→Z and every object's keys are alphabetical, so a field is easy to find in a long record. Arrays keep their order.
  • Use your browser's find. In Text view, Ctrl+F finds a word, such as a phone number or an error code, in the formatted output.

Step 6: copy or download what you need

Press Copy to copy the formatted result, or Download to save it. Beautified output downloads as data.json. If you want to send the JSON back to something that likes compact text, change Output style to Minify and copy again; it downloads as data.min.json.

Traps to watch for

Very long numbers are rounded

If a response contains an integer with more than about 16 digits, such as 9007199254740993, JavaScript cannot represent it exactly, so the formatted output shows a nearby value. The page shows a yellow warning when it spots one. This usually involves order, transaction or social-media IDs. They should be sent as strings. Always compare against the original text before trusting such an ID.

The result says "Invalid JSON"

A red message gives the line, column and a reason. If the problem is on line 1, column 1 and the character is a <, you copied an HTML error page, such as a login or 404 page, instead of the JSON. Look at the request's status code. If instead the text ends abruptly, the response was cut off. The full list of messages is in the JSON Validator guide, and the HTML case is explained in what "unexpected token" means.

The whole result is one long string

If the green note says "top level is a string", the JSON was wrapped inside another string, with backslashes in front of every quote. That is double-encoded JSON. The formatter reads it once, so it shows you the string. Take the text between the outer quotes, remove the backslashes before the inner quotes, and paste it again.

Phone numbers and IDs with leading zeros

In the example, "phone": "01812345678" is a string and keeps its leading zero. If you see a number such as 1812345678 in a response, the zero was lost on the server side, which is a bug in that API rather than in the formatter.

When you need more than reading

  • Check that a response is valid before you parse it with the JSON Validator, which puts the verdict above the panels.
  • Compare two responses by sorting the keys of both and pasting them into the Text Diff Checker.
  • Turn an array of records into a spreadsheet with JSON to CSV.

For a tour of every setting on the formatter, read the complete JSON Formatter guide.

Quick checklist

  • Copy the whole response, first brace to last.
  • Beautify with 2 spaces, then switch to Tree for large data.
  • Read the top-level note and the stats before diving in.
  • Sort keys to find fields faster.
  • Check the original text for any long ID.

Frequently asked questions

What is minified JSON?
It is ordinary JSON with every optional space and line break removed, so the whole response sits on one line. The data is exactly the same as in the readable version; only the layout is different.
Is it safe to paste an API response into an online formatter?
With our JSON Formatter it is, because it works in your browser and does not send your text to a server. You should still avoid pasting live passwords or secret keys into any tool you do not need to.
Why does my API return minified JSON?
Removing whitespace makes the response smaller and faster to send, so most APIs and servers do it by default. Readable formatting is for humans, and programs do not need it.
Can I get the response readable without leaving the browser tab?
Browser developer tools can pretty-print a response in the Network tab, but a formatter gives you more: key sorting, a tree you can collapse and the line and column of any error. Use whichever is closer to hand.
What if the formatter shows an error instead of output?
Then the text is not valid JSON. Check the line and column, and look at the start of the text: a response that begins with a less-than sign is usually an HTML error page, not JSON.
Found this useful? Share it

Tools in this guide

Main tool

JSON Formatter

Paste messy or minified JSON to get clean, indented output instantly — or minify it for production.

Open tool

JSON Validator

Check whether your JSON is valid and get the exact line, column and reason for any error.

Open tool

JSON to CSV

Turn JSON arrays into a CSV you can open in Excel or Google Sheets.

Open tool

Text Diff Checker

Paste or open two versions of a text and see exactly what changed: added lines in green, removed lines in red.

Open tool

Back to all guides & blog