# JSON formatter

> Format, validate and minify JSON in your browser. Invalid JSON shows the line and column of the first error.

Source: https://ebrahimsameh.com/tools/json-formatter/

The JSON formatter pretty-prints, validates and minifies JSON. Paste it in and you get readable output, or the exact line and column where it breaks.

## How it works

The formatter parses your input with the browser's built-in JSON parser and prints it back with 2-space, 4-space or tab indentation, or minified onto one line. If parsing fails, it shows the parser's message with the line and column of the problem. Your data stays in your browser.

## Questions

### Why is my JSON invalid?

The usual causes are a trailing comma, single quotes, a comment or an unquoted key. JavaScript accepts some of these, but JSON accepts none of them.

### Is my data sent anywhere?

No. Parsing and formatting happen in your browser and nothing is uploaded.

### What's the difference between format and minify?

Format adds line breaks and indentation so people can read it. Minify removes all whitespace outside strings, which is what you want when you send or store JSON.
