JSON Validator / Formatter

1 Paste JSON   2 Validate & Format   3 View in Tree Format



You can validate your json. Validation works based on JSON.Parse() method

You can format your json. As part of Validation, Formatting also happens. For these actions "Format JSON" button should be clicked

You can view your json in Tree format once the given json is validated. Please note that without validation completion, You cannot see Tree View

If your json has any validation issue then error will be displayed on the top of the editor. By clicking on "Goto Error Line", the error line will be highlighted to quickly resolve the problem

1. What is JSON?

  • JSON or JavaScript Object Notation is a light weight structured data used to send between client and server
  • JSON is a language independent format. Many programming languages supports JSON
  • JSON is very easy to read and its a key value pair collection
  • JSON follows its own standards to form the data

2. How to format JSON? What is the JSON syntax?

The valid JSON should have the following formats

  • It should starts with object and object syntax is Format : {String : Value} e.g. { "Vehicle" : "Car"}
  • The "Value" can be in the following formats and it allows nested types
  • JSON is very easy to read and its a key value pair collection
  • JSON follows its own standards to form the data
    • Object Format : {String : Object} e.g. { "Vehicle" : {"Model" : "Car"}}
    • String Format : {String : String} e.g. { "Vehicle" : "Car"} - Backslash can be used to escape characters
    • Number Format : {String : Number} e.g. { "YearOfModel"" : 2015} - It accepts both sign integers
    • Boolean Format : {String : Boolean} e.g. { "IsBMW"" : true} / { "IsBMW"" : false}
    • Null Format : {String : Null} e.g. { "AirBag"" : null}
    • Array Format : {String : Array} where array format is [Value]. It starts with '[' and ends with ']'. Values will be separated by ',' and value can be in any of the above type or array itself or combination of both. e.g. { "Model" : ["X6","X7","X8"]}
  • For more JSON syntaxes please refer json.org

3. What are the advantages of JSON over XML?

Both XML and JSON follows their own standards and self explanatory tags. But still JSON has some unique advantages

  • JSON is light weight and has less tags.
  • We can easily parse Json objects compared to XML
  • JSON is a new format which is introduced in recent times where as XML is decades old.
  • JSON handles complex structure also in a easy way and it supports array
Both has unique advantages and disadvantages and it's up to you to decide whether you should go with XML or JSON based on your requirements.

4. How to pass JSON object through internet or to web server?

Generally the request should be in string format when you pass the data to web server. JSON.stringify() can be used to convert the object to string.

5. Is JSON has specific file format?

Yes. Json file can be saved as ".json" extension

6. How to communicate to the server that we are sending values in JSON format?

You can mention content-type as "application/json"
  • Released with basic functionalities of Json formatter, validator and tree viewer
  • Highlighting the error line feature has been introduced
  • JSON text box is changed to support Auto Grow
  • JSON FAQs has been added
  • Sample JSON data has been added to format
  • TreeView Collapse All/Expand All functionalities has been added
  • Full screen mode has been introduced for the JSON editor