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
curlcommand. - 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.



