JSON Validator and Formatter

JSON Validator And Formatter is a free online web-based tool that helps to validate and format the JSON data. So that people can read this easily.

 

JSON(JavaScript Object Notation) is a lightweight, data storage and transfer format. It is easy to read and write to people. Machines can parse and generate with ease. A wide variety of programming languages including JavaScript, PHP, Python, Ruby, and Java are used to generate and parse JSON data.

All kinds of errors you’ve made can be easily fixed without any difficulty. JSON Validator And Formatter check your code to meets the JSON(JavaScript Object notation) requirements and also checks the errors if you have made in the code. If you have errors like double-quotes, colons, curly braces, etc in your code, you will see a code error on that line.

The followings are the rules for creating JSON file:

  • JSON code should start with the left curly bracket “{” and ends with right curly bracket “}”.
    Example: { “name”: “John” }
  • Each name in the Object is a string and should be in double-quotes, and it should follow by a colon “:”.
  • Keys and values should be in proper quotes. Example: { “key”: “value” }
  • Extra comma: At the end of your collection, you should not add an extra comma.
    Example1: { “name”: “John”, } – It will show an error.
    Correct Example: { “name”: “John” }
    Examples2: {“names”:[ “John”, “Lee”],} – It will show an error.
    Correct Example2: {“names”:[ “John”, “Lee”]}

How It Works:

JSON Validator And Formatter read your code and validate them. The following are the steps to validate and format the JSON code:

  1. Copy your JSON code which you have written and paste into the text area.JSON Validator Formatter
  2. Click on the “Validate JSON” button.JSON Validator Button
  3. If JSON code is valid then it will show “Valid JSON”. Valid JSON
  4. If JSON code is invalid then it will show the error. You can correct those errors and validate them again.Invalid JSON