JSON formatter and validator online

Paste JSON and the formatter checks it right away, then indents it with 2 or 4 spaces or tabs, or minifies it into one line. On an error it shows the line and column and explains the cause: a trailing comma, single quotes or an unclosed bracket. The data is processed in your browser and never sent anywhere.

Build it in the builder

Loading the tool...

How to set it up

  1. 1

    Paste JSON

    Copy an API response, a config file or a request body and paste it into the "Source JSON" field. The check runs on its own, there is no button to press.

  2. 2

    Fix errors

    If the JSON is broken, the line, the column and the cause appear under the field. The "Show the error" button selects the exact character in the text.

  3. 3

    Choose the layout

    "Indented" puts every value on its own line with 2 or 4 spaces or a tab. "One line" removes spaces and line breaks, which is handy for requests and environment variables.

  4. 4

    Sort the keys

    The "Sort keys alphabetically" box orders the keys of every object at every level. It makes two API responses much easier to compare.

  5. 5

    Copy the result

    The "Copy" button puts the formatted JSON on the clipboard. Numbers and strings stay exactly as they were, long ids are not rounded.

Frequently asked questions

The usual causes are a comma after the last item, single quotes instead of double quotes, keys without quotes and comments. JavaScript allows all of them, JSON does not. The formatter names the exact cause and where it was found.

Yes. Checking and formatting run in your browser, the text is not sent to a server and is not stored anywhere. Close the tab and the data is gone.

No. Many formatters pass the data through JSON.parse, and integers above 9007199254740991, such as long database ids, lose their last digits. Here numbers and strings are copied to the result character for character, only whitespace changes, plus the key order when sorting is on.

Two spaces are the most common choice in APIs and configs. Four spaces are easier to read with deep nesting. Tabs are for projects that already use them. To send JSON over the network or keep it in an environment variable, minify it into one line.

In the nana800 builder you write JSON in the body of an HTTP request, in a webhook response and in the data of a JWT. When the request body is valid JSON, the request block adds the Content-Type: application/json header by itself. Checking JSON here before pasting it into a block saves a failed scheme run.

Build your first scheme for free

Sign-up is free and needs no card. Every month the balance is topped up to $3.50 for free, enough for about 3,500 runs of basic blocks.

Build it in the builder