JSON formatter and validator

Pretty-print, minify, validate, and convert JSON without sending it anywhere.

Runs locally in your browser. Nothing is uploaded.

Optional. Compare it with the first box.

How to format and validate JSON

Paste JSON into the box and choose Format. The page parses it with JSON.parse and prints it again with a two-space or four-space indent. Minify removes the insignificant whitespace so the text is a single line, which is what you want in a log field or a query parameter. Validate parses the text and stops there, so you can check a payload without rewriting it.

When the text is not JSON, the message includes the line and column when the engine reports them. The usual mistakes are a trailing comma, a single-quoted string, a comment, or an unquoted key. JSON does not allow any of those. This page does not silently accept JSON5. If a config file has comments, remove them before you call it JSON.

Pretty printing does not sort keys and it does not drop unknown fields. The value you get back is the value that was parsed. Numbers that JSON can represent stay numbers. Very large integers can lose precision because JSON numbers are IEEE-754 doubles. If an identifier must stay exact, keep it in a string in the source.

YAML, CSV, and a diff

JSON to YAML and YAML to JSON use a JSON-compatible YAML schema, so the conversion stays close to JSON’s types. Dates and custom tags are not the point of this tool. CSV export accepts an array of objects, an array of arrays, or a single object written as key and value columns. CSV import treats the first row as column names and rejects a repeated name. Fields that contain commas, quotes, or line breaks are quoted.

The diff compares two JSON values by structure. Added keys, removed keys, and changed values are listed with a path. Arrays are compared by index, not as a bag of items, so inserting a row shifts every later index. That is the predictable reading for an API payload. The list stops after 200 changes so a huge document cannot lock the tab.

People paste tokens, customer records, and production config into online formatters. Those sites receive the text. This one parses it in the browser. Use the JWT decoder when the text is a token, and the regex tester when you are extracting a field rather than parsing a document.

Common questions

Does formatting fix invalid JSON?

No. Format and minify both require a successful parse. Fix the syntax, then format. The validator is the same parser, so a file that validates will format.

Why did a number change?

JSON has one number type. Integers larger than 2^53−1 are not exact in JavaScript. Put those values in strings if the digits themselves matter.

Can I convert YAML that uses anchors?

The converter is aimed at JSON-shaped documents. Exotic YAML features are outside what a JSON round trip can keep. If the YAML is a normal map or list of scalars, it converts.

Is the text stored?

No. There is no request with your document in it. Closing the tab drops the text with the page.