5 useful JSON tools to improve your productivity
Tags: json, webdev
Published: 2023-04-11 17:35:43

**Written by [Hassan Djirdeh](https://blog.logrocket.com/author/hassandjirdeh/)✏️**


JavaScript Object Notation (JSON) is a [lightweight data-interchange format](https://www.json.org/) that is widely used in web applications and APIs to transmit data between servers and clients. JSON is a popular choice for data storage and exchange due to it being human-readable, platform-independent, and capable of supporting complex data structures. In this article, we'll explore five useful JSON tools that can help you improve your productivity. 

_Jump ahead:_

*   [Data visualization with JSON Crack](#data-visualization-json-crack)
*   [Reading and exploring data with JSON Hero](#reading-exploring-data-json-hero)
*   [Format data with JSON Formatter & Validator](#format-data-json-formatter-validator)
*   [Convert data to CSV with Konklone.io](#convert-data-csv-konkloneio)
*   [Validate data with JSON Schema](#validate-date-json-schema)

## Data visualization with JSON Crack <a name="data-visualization-json-crack">

[JSON Crack](https://jsoncrack.com/) is a powerful tool for visualizing JSON data that allows us to quickly and easily create interactive visualizations to help us understand our data better. 

For example, assume we had a JSON structure that looks like the following:

```json
{
  "person":{
    "name":"John",
    "age":20,
    "address":{
      "street":"123 Main Street",
      "city":"New York"
    }
  }
}
```

This JSON structure contains information about a person that includes their name, age, and address. We could use JSON Crack to quickly create a visualization of the data, allowing us to quickly and easily view all the information at once. ![Data Visualization With JSON Crack](https://blog.logrocket.com/wp-content/uploads/2023/03/data-visualization-json-crack.jpeg) 

If we were to select a certain node in our graphical JSON tree, we can get more information about the node and its children: ![Selecting A Certain Node In Our Graphical JSON Tree](https://blog.logrocket.com/wp-content/uploads/2023/03/selecting-node-graphical-json-tree.jpeg) 

We're also able to use the search bar to quickly search for a node in our JSON tree by searching for certain key names or values: ![Searching For A Specific Node In Our JSON Tree Using The Search Bar](https://blog.logrocket.com/wp-content/uploads/2023/03/searching-specific-node-json-tree-search-bar.jpeg) 

JSON Crack becomes even more useful in situations where we have a large complex JSON structure. As an example, if we were to observe a JSON structure like the following:

```json
{
  "person": {
    "name": "John",
    "age": 20,
    "address": {
      "street": "123 Main Street",
      "city": "New York"
    },
    "phone_numbers": [
      {
        "type": "Home",
        "number": "555-1234"
      },
      {
        "type": "Work",
        "number": "555-5678",
        "extension": "123"
      }
    ],
    "emails": [
      "john@example.com",
      "johndoe@gmail.com"
    ],
    "spouse": {
      "name": "Jane",
      "age": 22,
      "address": {
        "street": "456 Oak Avenue",
        "city": "New York"
      },
      "phone_numbers": [
        {
          "type": "Home",
          "number": "555-5678"
        },
        {
          "type": "Work",
          "number": "555-9101",
          "extension": "456"
        }
      ],
      "email": "jane@example.com"
    }
  }
}
```

JSON Crack makes it easy for us to get a quick overview of the data, which can identify any potential issues or areas that need improvement: ![JSON Crack Giving Us A Data Overview](https://blog.logrocket.com/wp-content/uploads/2023/03/json-crack-data-overview.jpeg)

## Reading and exploring data with JSON Hero <a name="reading-exploring-data-json-hero">

[JSON Hero](https://jsonhero.io/) is another JSON viewer that allows us to explore and navigate our JSON data quickly and easily. Instead of providing a graphical visualization like JSON Crack, it allows us to see the structure of JSON in either a column, tree, or JSON layout. 

In the column layout, we're able to view the children nodes of our JSON structure in separate columns: ![Viewing The Children Nodes Of Our JSON Structure](https://blog.logrocket.com/wp-content/uploads/2023/03/viewing-children-nodes-json-structure.jpeg) 

In the JSON layout, we're able to see the structure of our data in standard JSON but with the capability to select certain fields to gather more information: ![Viewing The Structure Of Our Data In Standard JSON](https://blog.logrocket.com/wp-content/uploads/2023/03/json-layout-structure-data-standard-json.jpeg) 

In the Tree layout, we can see our JSON structure displayed as a tree with nested branches used to reflect the child nodes of a parent: ![JSON Structure Displayed In A Tree Layout](https://blog.logrocket.com/wp-content/uploads/2023/03/json-structure-displayed-tree-layout.jpeg) 

JSON Hero also provides a powerful search capability where we're able to search our entire JSON structure quickly by searching for key names, key paths, or values. ![JSON Hero Search Capability](https://blog.logrocket.com/wp-content/uploads/2023/03/json-hero-search-capability.png) 

Lastly, JSON Hero also provides a very helpful content-preview capability where the application automatically infers the content of JSON string values to help show a preview. This works for date values, image URLs, colors, website URLs, and more: ![JSON Hero Content's Preview Capability](https://blog.logrocket.com/wp-content/uploads/2023/03/json-hero-content-preview-capability.png)

## Format data with JSON Formatter & Validator <a name="format-data-json-formatter-validator">

[JSON Formatter & Validator](https://jsonformatter.curiousconcept.com/) is a tool that helps format JSON data in a readable and organized manner. It automatically indents and formats JSON data making it easier to read and understand. 

Assume we had the following unformatted JSON structure:

```json
{"Person":{"Name":"John","Age":20,"Address":{"Street":"123 Main Street","City":"New York"}}}
```

The above JSON is valid but missing any indentation or line breaks, which make it difficult to read. JSON Formatter & Validator can help quickly format and beautify the JSON data: ![JSON Formatter And Validator Helping Format JSON Data ](https://blog.logrocket.com/wp-content/uploads/2023/03/json-formatter-validator-formatting-json-data.jpeg) 

The JSON Formatter & Validator tool can also notify us of common JSON errors like incorrect quotes, missing quotes, trailing commas, etc. If we were to provide the following invalid JSON structure:

```json
{
  'Person': {
    'Name": "John,
    "Age": 20,
    "Address": {
      "Street": "123 Main Street",
      "City": "New York",
    },
  }
}
```

JSON Formatter will repair some of the issues it notices but also provide us with a breakdown of other errors that we'll need to fix on our own: ![JSON Formatter Listing Errors](https://blog.logrocket.com/wp-content/uploads/2023/03/json-formatter-listing-errors.jpeg)

## Convert data to CSV with Konklone.io <a name="convert-data-csv-konkloneio">

There exist many different tools that help convert JSON data to other formats like XML, CSV, YAML, etc. One tool that I've liked within this category is [Konklone.io](https://konklone.io/json/), built by [Eric Mill](https://konklone.com/), because it acts as a lightweight and simple tool to help quickly convert JSON data into CSV. 

When pasting JSON data structured to contain an array of values like the following:

```json
{
  "people": [
    {
      "name": "John",
      "age": 20,
      "address": {
        "street": "123 Main Street",
        "city": "New York"
      }
    },
    {
      "name": "Jane",
      "age": 25,
      "address": {
        "street": "456 Elm Street",
        "city": "Los Angeles"
      }
    },
    {
      "name": "Bob",
      "age": 30,
      "address": {
        "street": "789 Oak Street",
        "city": "Chicago"
      }
    }
  ]
}
```

The tool helps surface a preview of the CSV data that's been converted from JSON: ![A Preview Of CSV Data Converted From JSON](https://blog.logrocket.com/wp-content/uploads/2023/03/preview-csv-data-converted-from-json.jpeg)

We're then able to download the entire generated CSV for later use. One thing to keep in mind when using this tool is that because the JSON to CSV conversion is all done inside the browser, attempting to convert large JSON data into CSV may cause some issues.

## Validate data with JSON Schema <a name="validate-date-json-schema">

The last item we'll talk about today is [JSON Schema](https://json-schema.org/), which allows us to validate our JSON data against a schema. To understand the helpfulness of this concept, it’s important to first understand what a JSON Schema is. 

A JSON Schema is a declarative language that describes the expected structure and content of JSON data. The Schema can include information about the data types of fields, minimum and maximum values, patterns, and other constraints. For example, let's consider the simple JSON object example we used earlier to represent information about a person:

```json
{
  "person":{
    "name":"John",
    "age":20,
    "address":{
      "street":"123 Main Street",
      "city":"New York"
    }
  }
}
```

Even with this simple structure, there are many ways that this data could be represented differently. For example, the `"name"` key could be represented as `"person_name"` and the `"age"` key could be represented as `"person_age"`. Additionally, the `"address"` key could be represented as `"person_address"` but contain a single string value:

```json
{
  "person":{
    "person_name":"John",
    "person_age":20,
    "person_address": "123 Main Street, New York"
    }
  }
}
```

Both examples above describe the same person and are equally valid. However, they're still structured differently. How JSON data should be structured depends entirely on how it's meant to be used within an application. This is where JSON Schema comes in. 

We can use JSON Schema to validate that our data adheres to a specific structure. [A](https://github.com/ajv-validator/ajv)[jv](https://github.com/ajv-validator/ajv) is one popular validator tool for JavaScript applications that allows us to create a schema and then validate JSON against that schema. Here's an example of using Ajv to validate one of the above JSON examples against a schema:

```json
import Ajv from "ajv"

const ajv = new Ajv()

const schema = {
  type: "object",
  properties: {
    name: {type: "string"},
    age: {type: "number", minimum: 0, maximum: 150},
    address: {
      type: "object",
      properties: {
        street: {type: "string"},
        city: {type: "string"},
      },
      required: ["street", "city"],
    },
  },
  required: ["name", "age", "address"],
  additionalProperties: false,
};

const data = {
  name: "John",
  age: 30,
  address: {
    street: "123 Main Street",
    city: "New York"
  }
}

const validate = ajv.compile(schema)
const valid = validate(data)

// if not valid, console.log the validation errors
if (!valid) console.log(validate.errors)
```

The schema we've defined above describes a JSON object with three properties: `name` (string), `age` (a number between zero to 150), and `address` (an object that contains two string properties: `street` and `city`). All properties are required and no additional properties beyond those explicitly listed in the schema are allowed. 

Outside of validators, many other implementations and tools exist within the capability of using a JSON Schema. These include schema generators, format converters, and other utilities. The [Implementations](https://json-schema.org/implementations.html) section of the JSON Schema website highlights a list of these other tools and implementations. 

JSON Schema can help us avoid any potential issues down the line by providing us with a way to validate our JSON data against a pre-defined schema. This ensures that our JSON data is always structured correctly, which can help prevent any unexpected errors or discrepancies in our applications. For more additional reading, the [Understanding JSON Schema](https://json-schema.org/understanding-json-schema/index.html) section of the JSON Schema is helpful.

## Conclusion

As we've seen in this article, there are many different tools available to help us work with JSON data. From visualizing and exploring data with [JSON Crack](https://jsoncrack.com/), formatting it with [JSON Formatter & Validator](https://jsonformatter.curiousconcept.com/), converting it to other formats like CSV with Konklone.io, and validating it against a schema with [JSON Schema](https://json-schema.org/) — these tools can help make working with JSON data much easier and more efficient.