Skip to content

JSON Formatter and Validator

Paste JSON to make it readable, check that it is valid, or compress it again. Errors point to the exact line and column.

Output

Your result will appear here.

Nothing to check yet

1 line · UTF-8

Processed locallyFiles and text are processed in your browser and are not uploaded to our servers.Learn more

How to format JSON

  1. 01

    Paste your JSON

    Drop an API response, config file or log line into the input editor.

  2. 02

    Format, validate or minify

    Choose 2 spaces, 4 spaces or tabs. Validate only checks the syntax and leaves the output as it is.

  3. 03

    Copy or download

    Copy the result or save it as formatted.json.

Strict, standard JSON

The input is parsed with the browser's standard JSON parser and never executed as code. That also means only real JSON is accepted: comments, trailing commas, single quotes and unquoted keys are syntax errors, just as they would be in an API or JSON.parse.

When parsing fails, the message names the line and column, so you can find a missing comma or bracket in a long document.

Things formatting can change

  • Numbers beyond 2^53, such as 64-bit IDs, lose precision because JavaScript stores numbers as doubles. Keep such IDs as strings.
  • If an object repeats a key, only the last value remains.
  • Keys that look like whole numbers, such as "2" and "10", are listed first in ascending order; other keys keep their order.

Related tools

Frequently asked questions

Does this JSON formatter validate JSON?

Yes. Formatting only succeeds for valid JSON, and the Validate button checks syntax without changing the output. Errors report the line and column.

Why is my JSON with comments invalid?

Comments are not part of the JSON standard. Remove them, or use YAML, which does support comments.

Is my JSON sent to a server?

No. Parsing and formatting run in your browser on this page. The JSON you paste is not uploaded to WeDoConvert servers and is not included in analytics.

Should I indent with 2 spaces, 4 spaces or tabs?

Two spaces is the most common style for JSON in web projects. Match whatever your project or editor already uses.