Format and validate JSON

For developers reviewing an API response or configuration file, JSON Formatter reveals the structure and flags syntax problems before reuse.

Format JSON with clear indentation and validate its syntax before you copy, review or reuse the data. No upload or storage is involved.

How to use

  1. Paste the JSON you want to inspect into the input area, or import a .json file from your computer.
  2. Pick the indentation you prefer, from two spaces up to a tab.
  3. Run the formatting step and the document is rewritten with clearly indented levels that are easier to scan.
  4. If a syntax error is reported, fix the line involved and run the operation again.
  5. Copy the formatted output into your editor, your documentation or a bug report.

Example

The sample holds a small object with a site name and a page count. After formatting, check that the braces line up and that each key-value pair sits on its own line: that is exactly the layout you want when reading an API response.

Input

{"site":"example","pages":3}

Output

{
  "site": "example",
  "pages": 3
}

Limits and formats

Where processing happens

Formatting and validation run only inside your browser, on the text you paste or the file you import. Nothing is transmitted and nothing is kept after you close the page, which is welcome when the data comes from sensitive API responses.

Frequently asked questions

Does the tool tell me where the error is?

It reports that the document is not valid JSON, which points you in the right direction. For the exact line, compare against a shortened version of the same content or check the console in your code editor.

Can JSON contain comments?

No, the JSON format does not allow comments. Text that includes them will fail validation, even when it looks close to JSON and reads perfectly well to a human being.

Can I convert JSON to another format here?

No, this tool sticks to indenting and checking JSON. To produce CSV, YAML or XML, you need a dedicated converter that takes your document as its starting point.

Tools in the same category