JSON Formatter & Validator

Paste raw or minified JSON to pretty-print it with your preferred indentation, or collapse it to a single line. Real-time validation highlights errors with the native browser message so you know exactly what went wrong. Everything runs in your browser — nothing is sent to a server.

Input
Paste JSON above to get started
Output

Advertisement

Frequently Asked Questions

What is JSON?

JSON (JavaScript Object Notation) is a lightweight text format for storing and transporting structured data. It uses key-value pairs and ordered arrays, and is the standard data format for web APIs and configuration files.

Why is my JSON invalid?

Common mistakes include: trailing commas after the last item in an object or array, single-quoted strings (JSON requires double quotes), unquoted property names, and using JavaScript values like undefined or NaN, which are not valid in JSON.

What does "Format / Make it Pretty" do?

It re-serializes your JSON with line breaks and your chosen indentation (2 spaces, 4 spaces, or tab) so the structure is easy to read at a glance. The JSON content itself is unchanged.

What does "Minify" do?

Minify removes all whitespace (spaces, tabs, newlines) that is not inside a string value, producing the most compact valid representation. Useful for reducing payload size when sending JSON over a network.

What does "Sort Keys" do?

It alphabetically sorts the keys of every object in your JSON, recursively. This makes it easier to compare two JSON documents or spot a missing field. Array order is always preserved.

Is my JSON data private?

Yes. All processing happens entirely in your browser using JavaScript. Your JSON is never uploaded to any server.