Skip to content
kitto works
All tools

JSON Formatter & Validator | Minify, Beautify, and Detect Syntax Errors

Format JSON with 2/4-space or tab indentation, or minify it, and see syntax errors with the exact line and column where they occur. Everything runs in your browser only — your JSON is never sent anywhere.

Output format

All input is processed in your browser only and is never sent anywhere.

Result

Enter JSON to see the formatted or validated result instantly.

How to use

  1. Paste your JSON into the input box.
  2. Choose "Format" or "Minify". For Format, you can also choose the indent size (2 spaces, 4 spaces, or tab).
  3. The result appears instantly. If there's a syntax error, its message and location (line and column) are shown. Use "Copy result" to copy it to your clipboard.

How it works

How it works

This tool uses the browser's built-in JSON.parse / JSON.stringify — there is no custom JSON parser. As a result, input that doesn't strictly follow the JSON spec (RFC 8259) — trailing commas, single-quoted keys, comments, etc. — is treated as an error, exactly as any standard JavaScript engine would treat it.

Format

JSON.stringify(value, null, indent) converts the value into a readable, indented form. You can choose 2 spaces, 4 spaces, or a tab as the indent.

Minify

JSON.stringify(value) removes all unnecessary whitespace and line breaks to produce the smallest possible representation.

How syntax errors are shown

When a syntax error occurs, the tool shows the error message exactly as reported by your browser's JavaScript engine. If the message includes a character position, the tool scans the input independently to compute the line and column number and shows them alongside the message. If no position is included in the message, only the message is shown.

Input size limit

Input longer than 5,000,000 characters is rejected. Below that limit, the tool can handle fairly large JSON documents, subject to your browser's performance.

About Unicode characters

\uXXXX Unicode escapes are parsed correctly, and the formatted/minified output shows the actual character (e.g. \u3042 becomes 「あ」).

FAQ

Is my JSON sent anywhere?

No. Formatting, minifying, and validation all happen entirely in your browser. Nothing is sent to any server.

Why does a trailing comma cause an error?

The JSON specification (RFC 8259) does not allow a comma after the last element of an object or array. While some JavaScript object literals tolerate this, it is invalid JSON. Since this tool uses the browser's native JSON parser, it flags this the same way any standards-compliant engine would.

Can I format JSON that contains comments or single-quoted keys?

No. The JSON spec does not allow comments, and keys and strings must be wrapped in double quotes. Such input is treated as a syntax error. Extended formats like JSON5 or JSONC are not supported.

Why does the error message wording differ between browsers?

The exact wording comes directly from your browser's JavaScript engine (V8, SpiderMonkey, JavaScriptCore, etc.). The phrasing differs by engine, but what counts as invalid is determined by the same JSON specification in every case.

Can I format very large JSON files?

Yes, up to 5,000,000 characters. Beyond that limit the input is rejected. For very large JSON, rendering may be slower depending on your browser's performance.