Online JSON Formatter

Updated: Dec 3, 2018
JSON   FORMATTING  

JSON Formatter is used to Format JSON text, documents or files by indenting & syntax highlighting them. This JSON Viewer shows the objects in a human readable tree like structure which can be easily expanded/collapsed. You can also choose whether to convert the property names in camel case. Dates in your JSON data can be converted to ISO or Microsoft date formats. Optionally, you can remove escape characters from the created JSON.

Input: Paste JSON text below



Settings


JavaScript Object Notation (JSON) pronounced as "Jason" is the de facto standard for data interchange on the web these days. It is a simple format that is easier to comprehend than XML. It also has less size than XML because of no closing tags. Interacting with JSON from JavaScript is extremely seamless. JSON format was first specified by Douglas Crockford in the early 2000s
Indent
This setting governs whether or not the output is indented. The indented output is easier for humans to comprehend. On the other hand, a non-indented output is compact & smaller in size (best for transmission). So, JSON is often minified which compacts & compresses the output by removing non-essential whitespace. This is the most important use of this tool as people paste the minified JSON and try to understand what's in it via indentation.
Indentation On
{
  "name": "John Doe",
  "age": 69
}
Indentation Off
{"name":"John Doe","age":69}
Keys In Quotes
A valid JSON must have double quotes around the keys (or property names). However, when used directly inside JavaScript, this is not necessary (unless the keys have special characters in them). So, if you intend to use the output directly inside JavaScript, deselect this option.
Keys In Quotes On
{"name":"John Doe","age":69}
Keys In Quotes Off
{name:"John Doe",age:69}
Camel Case Property Names
When this option is selected, the casing of keys is converted to lowerCamelCase. This is the default naming convention of JSON fields & JavaScript variables.
Camel Case On
{"personName":"John Doe"}
Camel Case Off
{"PersonName":"John Doe"}

Use this option only when you are trying to cleanse a JSON structure because changing the keys will result in failure in applications that make use of this JSON format.
Expanded Braces
When this option is selected, braces are written on a new line (C# style). Otherwise braces are written on the same line (Java/JavaScript style).
Expanded Braces On
{
  "name": "John Doe",
  "age": 25,
  "addresses":
  [
    {
      "city": "Phoenix",
      "country": "Arizona"
    },
    {
      "city": "Miami",
      "country": "Florida"
    }
  ]
}
Expanded Braces Off
{
  "name": "John Doe",
  "age": 25,
  "addresses": [
    {
      "city": "Phoenix",
      "country": "Arizona"
    },
    {
      "city": "Miami",
      "country": "Florida"
    }
  ]
}
Remove Escape Characters
Use this setting to remove escape characters in JSON Formatter. This implies that all backslash characters preceding a double quote are removed, thus unescaping the input JSON. This is needed if your JSON input has been escaped and is present in string form.
Input
"{\"personName\":\"John Doe\"}"
Remove Escape Characters On
{
  "personName": "John Doe"
}
Remove Escape Characters Off
"{\"personName\":\"John Doe\"}"

Cannot be used together with 'Format Embedded JSON'
Format Embedded JSON
When this option is selected, JSON that is embedded or escaped within string values is processed, expanded & converted to nodes.
Format Embedded JSON On
{
  "name": "John Doe",
  "age": 25,
  "addresses": [
    {
      "city": "Phoenix",
      "country": "Arizona"
    },
    {
      "city": "Miami",
      "country": "Florida"
    }
  ]
}
Format Embedded JSON Off
{
  "name": "John Doe",
  "age": 25,
  "addresses": "[{\"city\":\"Phoenix\",\"country\":\"Arizona\"},{\"city\":\"Miami\",\"country\":\"Florida\"}]"
}
Date Format Handling
Even though, there is no standard for representing dates in JSON, two popular formats have emerged. The ISO Date Format being the most widely used. If you are using a .NET stack, quite possibly you are using the Microsoft Date Format.
ISO Date Format
{"systemTime":"2014-01-01T23:28:56.782Z"}
Microsoft Date Format
{"systemTime":"\/Date(1388618936782)\/"}
Quote Character
The custom quote character to use for wrapping string values and property names. You can choose between single quote ' and double quote ".
Quote Character: "
{
  "name": "John Doe",
  "age": 69
}
Quote Character: '
{
  'name': 'John Doe',
  'age': 69
}
 

History

Dec 1, 2018
Support for removing escape characters
Jun 29, 2018
Support for customizing quote character
New Data tools -
Sep 24, 2017
Support for embedded JSON formatting
Sep 23, 2017
Expanded brace style & setting to skip adding quotes around keys
Sep 19, 2017
Date format settings
Sep 2, 2017
Tool Launched

Created: Sep 2, 2017
Online Tool Designed For: Windows, OS X, Android, iOS, Linux