JSON Formatter

This Online JSON Formatter tool can be used to convert your JSON to one line or format it using an specified level of indentation. More.

This is a client side utility. Your data will NOT leave your own browser.

How it works?

JSON Formatter online: This Online JSON Formatter tool can be used to convert your JSON to one line or format it using an specified level of indentation.

  • Single line: Convert the JSON to single line result, removing all spaces. Transforming the JSON to one line can be useful in various development activities.
  • 2, 3 and 4 Spaces and Tabs: Formats the JSON using an specified level of indentation.

See the examples of usage below.

Examples

Unformatted JSON
{ "note": { "to": "Tove", "from": "Jani", "heading": "Reminder", "body": "Don't forget me this weekend!" } }
Formatted JSON
{
  "note": {
    "to": "Tove",
    "from": "Jani",
    "heading": "Reminder",
    "body": "Don't forget me this weekend!"
  }
}
Formatted JSON
{
  "note": {
    "to": "Tove",
    "from": "Jani",
    "heading": "Reminder",
    "body": "Don't forget me this weekend!"
  }
}
Single line JSON
{"note":{"to":"Tove","from":"Jani","heading":"Reminder","body":"Don't forget me this weekend!"}}

Tutorials

How to format JSON to one line

Follow these steps to quickly format your JSON to one line.
  1. Enter the JSON input
    • Paste your well-formed JSON into the input area.
  2. Select the formatting option
    • Select the "Single line" option and click "Submit".
  3. All done
    • Your JSON is ready. Click the "Copy to Clipboard" button and you should be ready to rock!

More information

JSON (JavaScript Object Notation) is an alternative to XML, which is also an open standard format that uses human-readable text to describe data objects consisting of attributes and values.

The JSON data structure is less verbose than XML, and still simple, so it has been adopted as the first option for projects that requires data transportation, since it tends to have a better performance and consumes less bandwidth.

JSON structure:

  • An object in JSON starts and ends with ‘{‘ and ‘}’ respectively. Between the brackets, it has a number of string value pairs
  • The String (attribute name) is separated from the value with a ‘:’
  • Arrays are stored within square brackets: ‘[’ and ‘]’
  • Values inside a JSON object can be of the following types: String, Number, Object, Array, True, False or Null
  • A String value can contain a collection of none or more UNICODE characters (excepted double quotes, ‘\’ or control chars), enclosed by double quotes.

Looking for something else?

In case you are looking for something else than this functionality, please let us know by contacting us. The most common requests will be made available (for free) once possible.