Online tool to validate, format and beautify your JSON.

1) Copy/paste or upload your JSON. 2) Set up options: Indent your JSON as you wish. Remove double quotes around numbers. Remove double quotes on keys. Collapse short arrays. 3) Validate and format your JSON. 4) Save your result for later or for sharing.

     
Download Copy
Bug or suggestion?

Node.js

This function is available as a npm package.

About JSON

  • JSON stands for JavaScript Object Notation. It is a lightweight data-interchange format and fully described on www.json.org.
  • JSON is based on Javascript but the format is stricter. JSON requires double quotes around keys whereas Javascript does not. For example, this is valid Javascript:
    {pi: 3.14159265359, e: 2.7182818284, prime: [2, 3, 5, 7, 11, 13, 17, 19]}
    However the above is not valid JSON. Double quotes must be placed around pi, e and prime.
    {"pi": 3.14159265359, "e": 2.7182818284, "prime": [2, 3, 5, 7, 11, 13, 17, 19]}
    CSVJSON's JSON Beautifier has a toggle to drop quotes on keys. It can do so if Javascript allows it. For example, we cannot drop quotes around key "1+6". CSVJSON also has a toggle to use single quotes to wrap keys and values.
  • Modern browsers have a built-in global object JSON with encoding and decoding functions. These are:
    • JSON.stringify to encode a Javascript object into a JSON string; and
    • JSON.parse to parse a JSON string and convert it to a Javascript object.
    To support older browsers, use JSON2 written by Douglas Crockford as polyfill.
  • CSVJON uses a modified version of JSON2 which adds formatting options to drop quotes on keys, and sepcify the quote type. Anyone is free to use and extend it by forking the CSVJSON Github repo.

Change Log

  • Feb 3, 2019 Refactored and published npm package json_beautifier.
  • Jan 26, 2019 Improvement: Removed 64k limit on download button.
  • Dec 18, 2017 Improvement: Added option to minify or compact JSON. GitHub issue #21
  • Oct 7, 2017 Improvement: Abimbola Idowu added single quote option. GitHub issue #23
  • Sep 27, 2016 Bug fix: Inline short arrays bug fix and improvement. Added nesting depth option. GitHub issue #12
  • Aug 22, 2016 Bug fix: Inline short arrays was not working properly. GitHub issue #9
  • Dec 30, 2015 Bug fix: drop quotes on keys of nested objects.
  • Jun 1, 2015 Bug fix: proper support of commas inside quotes.
  • Jan 12, 2014 Initial release.

Feedback

Code available on Github. Report bugs or ask for improvements through Github issues.