Online JSON beautifier and formatter

Format and beautify your JSON data online with this free tool. Beautify JSON data by adding spaces or tabs and line returns to make it more readable.

What is JSON?

JSON (JavaScript Object Notation) is a lightweight data interchange format. It is easy to read and write and easy to parse and generate using code.
It is based on a subset of the JavaScript programming language.

JSON is a text format that is completely language independent but uses conventions that are familiar to programmers of many languages like C, C++, C#, Java or JavaScript. These properties make JSON an ideal data-interchange language.

JSON syntax

JSON is built on two universal data structures:

  • A collection of unordered name/value pairs: usually called in other languages, object, record, struct, dictionary, hash table, keyed list, or associative array.
  • An ordered list of values: called in other languages, array, vector, list, or sequence.

The JSON syntax is derived from the JavaScript object notation syntax:

  • Curly braces hold objects name/value pairs {...}
  • Square brackets hold arrays [...]
  • Object name/value pairs are separated by a colon"name": "value"
  • Object and array members are separated by commas [1,2,3]
  • Object names are enclosed in double quotes "name"
  • Object names must be unique within the object
  • String values must be enclosed in double quotes
  • Values can be one of the following data types:
    • a string "value"
    • a number-5.56e7
    • an object{...}
    • an array [...]
    • a boolean true orfalse
    • nullnull

Most common JSON formatting

Formatting JSON data is a common task when working with JSON. It makes the JSON data more readable and easier to understand. Here are some common formatting rules:

  • Indentation: Indentation is usually done using spaces or tabs. The most common indentation is 2 spaces or 4 spaces, or a tab. There is no strict rule for the indentation as JSON is a serialization format not a presentation format.
  • Line breaks: Line breaks are used to separate different objects or arrays. Extra line breaks are usually not used as they add unnecessary space to the JSON data.