Skip to content

JSON Formatter

Runs in your browser — your data never leaves your device.

Format, validate and minify JSON with clear error messages.

Options
0 lines
0 lines

What is JSON Formatter?

A JSON formatter turns compact or messy JSON into indented, readable text and checks that it is valid. It can also do the opposite and minify JSON to save space. Everything happens in your browser.

Useful for

  • Reading API responses that arrive on a single line.
  • Finding the exact line of a syntax error in a config file.
  • Minifying JSON before embedding it in code or a request.

How to use

  1. Paste your JSON into the input panel.
  2. Choose an indentation of 2 spaces, 4 spaces or tabs, or pick Minify.
  3. Copy the formatted result, or read the error message to fix invalid JSON.

Examples

Pretty-print a compact object

Input
{"id":1,"tags":["a","b"]}
Output
{
  "id": 1,
  "tags": [
    "a",
    "b"
  ]
}

Frequently asked questions

Is my JSON sent to a server?

No. Formatting and validation run entirely in your browser, so private data never leaves your device.

Does it accept comments or trailing commas?

Standard JSON allows neither. The validator points to them so you can remove them.

Does formatting change my numbers or keys?

No. Values are printed exactly as you wrote them, so large IDs such as 12345678901234567890 keep every digit, escapes stay as they are and the key order never changes.

Related tools