JSON Formatter

The JSON Formatter can be used to convert JSON to one line or format it using a specified level of indentation. More.

We depend on ads to keep our content free for you.
Please consider disabling your ad blocker.

This is a client-side utility. Your data will NOT leave your own browser.
Copy shareable link is limited to 5,000 characters as it uses a client-side feature.

How it works?

JSON Formatter online: The JSON Formatter can be used to convert JSON to one line or format it using a specified level of indentation.

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

See the examples of usage below.


Unformatted JSON
{ "note": {"from": "Jessy", "to": "Joe", "title": "Water bill", "body": "Do not forget the water bill this week!" } }
Formatted JSON (2 spaces indentation)
  "note": {
    "from": "Jessy",
    "to": "Joe",
    "title": "Water bill",
    "body": "Do not forget the water bill this week!"
Formatted JSON
  "note": {
    "from": "Jessy",
    "to": "Joe",
    "title": "Water bill",
    "body": "Do not forget the water bill this week!"
Single line JSON (unnecessary spaces removed)
{"note":{"from":"Jessy","to":"Joe","title":"Water bill","body":"Do not forget the water bill this week!"}}


How to convert JSON to one line

Follow these steps to quickly format your multiline JSON to one line.
  1. Prepare your JSON input
    • Have your JSON text in a valid format ready to be used.
  2. Enter the data
    • Paste your well-formed JSON into the input area.
  3. Select the formatting option
    • Click on the "Options" button and select the "Single line" item.
  4. Submit
    • Click the "Submit" button. You should now see the output JSON in one single line.
  5. All done
    • Your JSON is ready. Click the "Copy to Clipboard" button, and you should be ready to rock!

More information

What is it?

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 require data transportation, since it tends to have better performance while consuming less network bandwidth. The standard permits the file to be formatted (also referred to as beautify), allowing better visualization of its contents. Additionally, the JSON data can be transformed into one line, removing unnecessary spaces and saving additional bandwidth.


Although the JSON syntax resembles JavaScript (it is based on JavaScript - no surprise), this data format can be used in any programming language. In fact, every popular programming language will commonly provide some support for dealing with JSON data.

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 (except double-quotes, ‘\’ or control chars), enclosed by double-quotes.

JSON and databases:

With so much popularity, JSON became a format commonly supported not only by NoSQL databases (such as MongoDB, Neo4J, Firestore, etc.) but also by traditional SQL databases including Oracle, MySQL and PostgreSQL to mention a few. The features provided by some of these databases include the capability of querying, indexing, and others, so it is not just plain text stored in the database!

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.