Skip to content
You're offline. Some features may not work.

JSON / Code Tools

Format JSON instantly.

Beautify, minify, sort, and inspect. All in your browser.

The shared link contains the encoded JSON. Opening it adds the URL to browser history, and anyone with the link can read the data.
Input
Output
Empty
Ctrl+Shift+F Format ·Ctrl+Shift+M Minify

How to format JSON online

  1. Open JSON Formatter

    Go to json-formatter.hanoon.app in your browser.

  2. Paste your JSON

    Paste or type your raw JSON data into the input editor.

  3. Format or minify

    Click Format to pretty-print with indentation, or Minify to compress. Copy the result with one click.

What is JSON formatting?

Format adds line breaks with 2-space, 4-space, or tab indentation. Format and Minify keep object-key order; Sort Keys reorders keys. All three preserve duplicate keys and number text such as 9007199254740993 and 1.2300, though string escapes may be rewritten.

How do I minify JSON?

Minify removes unnecessary whitespace outside JSON strings. For example, { "name": "A B", "count": 2 } becomes {"name":"A B","count":2}; the space in "A B" stays.

Is my JSON data kept private?

Yes. Processing stays in your browser, and the app does not send your data to a server or save it to disk or localStorage. If you open a shared link, its encoded JSON URL can remain in browser history.

What happens with invalid JSON?

Invalid JSON is rejected with a syntax error and its line and column. Format does not repair it automatically. Choose Repair to try common syntax fixes; it can change the input, so review the result. Validate here checks syntax, not JSON Schema.

Can I convert between JSON and other formats?

Convert supports JSON → YAML, YAML → JSON, JSON → CSV, and JSON → TypeScript. JSON-to-YAML and JSON-to-CSV reject duplicate object keys instead of silently dropping them. TypeScript types are inferred from the sample; they are not a JSON Schema or a runtime validator.