Practical guide

Read and fix a JSON formatting error

Use a small example to identify missing commas, quotation marks and unexpected data types.

JSON is a text format for data, not a programming language. Its rules are strict: property names use double quotes, pairs in an object are separated by commas and strings must end with a matching quotation mark. The JSON Formatter can make valid JSON easier to read and report parsing errors, but it cannot safely guess what missing data was supposed to mean.

A common mistake

This example is invalid because there is no comma between the two properties:

{"name":"Amit" "active":true}

Add the comma to get {"name":"Amit","active":true}. Formatting the valid version puts the properties on separate lines so they are easier to inspect. Minifying removes unnecessary whitespace again; it should not change the values.

Check the type as well as the punctuation

"42" is a string, while 42 is a number. "false" is text, while false is a Boolean value. Both forms can be valid JSON, but a receiving app may treat them differently. After formatting, check that you did not accidentally put numbers or Boolean values in quotes.

  1. Paste a copy of the JSON into the editor.
  2. Run validation or formatting and read any error. Look near the reported position for missing commas, unclosed quotes or trailing commas.
  3. Correct the source and validate again. Copy or download only after the tool accepts it.

JSON pasted into a browser may contain credentials, tokens or customer records. This tool processes text locally, but you should still avoid sharing that text in bug reports or screenshots. Replace sensitive values with harmless samples when seeking help.

Explore all guides or browse all tools.