JSON Formatter for API Responses

Paste a response from your browser's network tab, curl, Postman or a log file. HTTP headers, JSONP wrappers and double-encoded JSON are detected automatically, and large IDs keep every digit.

Free · No sign-up

Paste JSON, open a file or load the sample. The result updates as you type.

Result
Result view

      
      
    
Format

How to use it

  1. Copy the response. In Chrome, Edge or Firefox open DevTools, select the request on the Network tab and copy the Response. From the terminal, use curl -s, or curl -i to include headers.
  2. Paste it into the input box. Headers, a JSONP callback or JSON stored as an escaped string are removed or decoded, and a note tells you what was changed.
  3. Switch to Tree view to explore nested data. Tap a value to see its path, such as $.data[0].attributes.email, and copy it for your code or a jq filter.
  4. Copy or download the formatted JSON, or choose Minify to get a compact request body.

Why use this tool

Raw HTTP responses

Paste the output of curl -i with status line and headers. The headers are skipped and the body is formatted.

JSONP and double encoding

callback({...}) wrappers are removed, and a JSON string full of \" escapes is decoded into real JSON.

64-bit IDs stay exact

IDs above 9,007,199,254,740,991 are shown exactly as the server sent them, with a note that JavaScript would round them.

Paths for nested values

Tap any value in the tree to copy its path, ready for JavaScript, jq or test assertions.

Duplicate key warnings

If an object repeats a key, you are told which one, because most clients keep only the last value.

Safe for real responses

Everything runs in your browser. Tokens, cookies and customer data in the response are never uploaded.

Where to copy an API response from

SourceHow to copy the JSON
Chrome, Edge, FirefoxDevTools (F12) › Network › select the request › Response tab › copy
SafariDevelop › Show Web Inspector › Network › select the request › Response
curlcurl -s https://api.example.com/items for the body, or curl -i to include headers
Postman, InsomniaResponse panel › Body › Raw, then copy
Server logsCopy the whole log line. If it was cut off, open the log file instead.

Why an API response is hard to read

APIs usually send JSON minified, without spaces or line breaks, because it is smaller and faster to transfer. A response with hundreds of records then arrives as one very long line.

Formatting adds indentation without changing any value, so you can see which fields exist, how arrays are nested and where pagination links or error details are. Tree view goes further: it folds big arrays and shows how many items each one contains.

Problems this page detects

  • HTTP headers before the body, for example from curl -i or a proxy log.
  • JSONP responses such as callback({"items": []}); from older APIs.
  • Double-encoded JSON: a string like "{\"id\":1}" that a server or logger escaped twice.
  • Duplicate keys, which different parsers handle differently.
  • Integers too large for JavaScript numbers, a common problem with database and social media IDs.
  • Syntax errors in hand-written request bodies, with the line, column and a one-click repair for common mistakes.

Large IDs in JavaScript

Many APIs return 64-bit integer IDs. JavaScript can only represent integers exactly up to 9,007,199,254,740,991, so response.json() turns 9007199254740993 into 9007199254740992 without any error.

Well-designed APIs send such IDs as strings, for example "id_str". If yours does not, parse the response with a library that supports BigInt, or ask the API provider for string IDs. This formatter shows the exact digits so you can spot the problem.

Frequently asked questions

Can I paste a response that includes HTTP headers?

Yes. If the text starts with a status line such as HTTP/1.1 200 OK, everything up to the first empty line is treated as headers and skipped. Only the body is formatted.

Is it safe to paste responses with tokens or personal data?

The page processes everything in your browser and sends nothing to a server, so the data stays on your device. As a habit, still remove access tokens before sharing a response with anyone.

Why does my JSON show \" everywhere?

The JSON was encoded twice and is now a string that contains JSON. This page decodes it automatically. In your own code, call JSON.parse twice or fix the server so it does not stringify the data a second time.

What is JSONP?

JSONP wraps JSON in a JavaScript function call, such as callback({...}), so older browsers could load data from another domain. Modern APIs use CORS instead. This page removes the wrapper so you can read the data.

How do I use the path in my code?

A path such as $.data[0].id means: take the data array, its first item, then the id field. In JavaScript write response.data[0].id, and in jq write .data[0].id.

Can it format XML or GraphQL responses?

GraphQL responses are JSON, so they work. XML is a different format and is not supported here.

Related tools

Need something built?

Tell us what you want to create.

Tell us what you need built, from a simple website to a complete app, AI solution, automation, or custom system.

Tell us what you want to build. We review every enquiry and reply by email.

Contact

Thanks, your enquiry is on its way.

We will review the details and reply by email.