curly{bits}

Format, validate and convert JSON. Nothing leaves your browser.

curlybits / JSON Formatter

JSON Formatter & Validator

Paste JSON to pretty-print it instantly. If it's invalid, you'll see the exact line and column of the problem, so you can fix it in seconds.

Input JSON
Formatted output

      

How to use the JSON Formatter & Validator

  1. Paste your JSON into the left box, or click Load sample.
  2. Pick an indent (2 spaces, 4 spaces or tab) and tick Sort keys if you want keys alphabetical.
  3. Read the result on the right. Errors show the line and column, and the cursor jumps to them.
  4. Click Copy to grab the formatted JSON.

What a JSON formatter does

APIs, log files and minified configs often return JSON as one long line. A formatter (also called a JSON beautifier or pretty-printer) adds line breaks and indentation so you can read the structure: which keys belong to which object, and where each array starts and ends.

{"id":1042,"paid":true,"items":["thai tea"]}

becomes

{
  "id": 1042,
  "paid": true,
  "items": [
    "thai tea"
  ]
}

Common JSON errors this validator catches

  • Trailing commas like [1, 2, ], which JavaScript allows but JSON does not.
  • Single quotes around strings or keys. JSON requires double quotes.
  • Unquoted keys such as {name: "Ann"}.
  • Comments (// or /* */), which are not part of the JSON standard.
  • Missing brackets or an extra closing brace.

Frequently asked questions

Is this JSON formatter free?

Yes. Every curlybits tool is free with no sign-up and no limits beyond what your browser can handle.

Is my JSON uploaded anywhere?

No. Formatting and validation run entirely in your browser with JavaScript. Your data never reaches a server.

How do I find the error in invalid JSON?

The status bar shows the error message with its line and column, and the cursor jumps to that spot in the input box.

Can I sort JSON keys alphabetically?

Yes. Tick Sort keys and every object, including nested ones, is output with its keys in alphabetical order. Array order is kept.

Add this json formatter to your website

Free for blogs, schools and businesses. Copy the code below and paste it into your page's HTML. The tool works exactly like this one and runs in your visitors' browsers, so nothing is uploaded. Please keep the credit line so others can find it too.

Preview embed ↗