Developer tool

JSON Formatter & Validator

Paste JSON to format, validate or minify it. Errors include a line and column so you can find the problem quickly.

Input 0 characters
Formatted output

Tip: press Ctrl+Enter (or Cmd+Enter on a Mac) to format.

Advertisement

What this tool does

JSON (JavaScript Object Notation) is a text format for structured data. It is strict: every key must use double quotes, commas separate items, and trailing commas are not allowed. A stray character can make an entire API response unreadable.

This formatter parses your input with the browser's built-in JSON parser, then prints it back with consistent indentation. If parsing fails, it shows the parser message and tries to point to the line and column where the problem was found.

How to use it

  1. Paste your JSON into the input box. The example loads automatically so you can see the output format.
  2. Select Format to pretty-print it, or Minify to remove whitespace.
  3. Use Copy or Download to take the result with you.

Formatting versus minifying

Pretty-printed JSON is easier for people to read and review. Minified JSON is smaller and is what you usually send over a network. The data is identical; only the whitespace changes.

How to read a JSON error

Browsers word their parser errors differently. You may see something like:

Unexpected token } in JSON at position 42

The position is a character offset from the start of the input. This tool also calculates the line and column when it can. Start at that location and look for a missing comma, an extra comma, a single-quoted string or an unquoted key. For worked examples, see how to validate JSON online.

Privacy and limits

Your JSON is parsed in this browser tab. It is not uploaded to NelcByte. Very large documents are limited by the memory and speed of your device, so a multi-megabyte file may take a moment or fail in an older browser.

Keep going

Related tools

Other utilities that pair well with this one.

All tools

Good to know

Questions

Is my JSON uploaded to a server?

No. The formatter is a JavaScript file loaded by your browser. The JSON you paste is processed on your device and is not sent to NelcByte.

Does it support comments or trailing commas?

No. Standard JSON does not allow comments or trailing commas. If you have JSON5 or JavaScript object syntax, remove those extras first.

Why does it reject a single-quoted string?

JSON requires double quotes around strings and property names. Single quotes are valid in JavaScript, but not in JSON.

Can I format very large files?

It depends on your browser and how much memory is available. Very large files may be slow. For routine API responses and configuration files, it should be fine.

Can I format a JSON file larger than a few megabytes?

The tool runs in the browser tab, so very large files may be slow or run out of memory. For big files, use a desktop tool or split the data first.

Can I convert JSON to another format?

No. This page formats, validates and minifies JSON. It does not convert JSON to CSV, YAML or XML.