Fix Common JSON Formatting Errors
Published · Updated
Ready to try it? Open JSON formatter validator and follow the example below.
Understand why a JSON document is rejected before changing its data.
Check the basic syntax
JSON property names and string values use double quotes. Comments and trailing commas are not part of JSON syntax. Objects use braces, arrays use brackets, and the opening and closing characters must match. A file that resembles JavaScript is not necessarily valid JSON.
Start with a small example
In the JSON formatter, try {"name":"Alex","active":true}. Formatting makes the structure easier to inspect; minifying removes unnecessary whitespace. Neither action decides whether your application expects those properties or values.
Read the error before editing
Use the error message to locate a likely problem, then check the nearby quote, comma or bracket. A missing quote can make an error appear later than its actual cause. Avoid changing values randomly until parsing succeeds. Keep a copy of the input so each edit can be compared with the original.
Check more than valid syntax
A valid JSON document can still contain incorrect data. The browser parser can round integers beyond JavaScript’s safe integer range, and duplicate property names may not behave as you expect. Do not use a formatting pass as a substitute for your application’s schema checks. Avoid pasting secrets or production credentials into shared devices.
