Back to Tools

JSON Formatter & Validator

Paste JSON to check that it parses and see it indented with two spaces, or switch to a minified version. If it doesn't parse, you get the error message from the parser.

JSON Input

Paste or type JSON

Formatted Output

Pretty-printed or minified

Enter JSON data to see the formatted output

How it works

Three steps, and the output updates as you type.

1

Paste your JSON

Paste JSON into the input box, or click Load Sample to try it with example data.

2

Format and validate

The JSON is parsed as you type. Click Format & Validate to run it again. If the JSON is invalid, an error appears in place of the output.

3

Copy or download

Choose Pretty or Minified, then copy the result or download it as a .json file.

Features

What the formatter does with your JSON.

Pretty print

Adds line breaks and two-space indentation so nested objects and arrays are easy to follow.

Validation

Every change is checked with the browser's JSON parser, so you know right away whether the JSON is valid.

Minification

Removes all whitespace between tokens to produce the smallest valid version of the same data.

Error messages

Invalid JSON shows the parser's error message, which in most browsers includes the position of the problem.

Copy

Copies the formatted or minified JSON to your clipboard.

Download

Saves the output as formatted-json.json.

Frequently asked questions

Is my data secure?

Yes. Formatting and validation run in your browser. Your JSON is not sent to a server or stored.

What is JSON validation?

It checks that the text follows JSON syntax: double-quoted keys and strings, no trailing commas, no comments. Valid JSON can be parsed by any standard JSON library.

Can I format large JSON files?

Files up to a few megabytes are usually fine. Beyond that, the page may slow down, depending on your browser and device.

Why would I need to minify JSON?

Minified JSON is smaller, so it takes less space in config files, URLs and network requests. Use pretty print when a person needs to read it.

Other JSON tools

Convert JSON to a table, CSV or XML, compare two files, or query with JSONPath.

View All Tools