←

JSON formatting


        
Instructions for use
Paste or enter JSON data, click Format to beautify the layout, or click Compress to remove whitespace. Supports automatic detection of JSON syntax errors.

Common JSON errors

Standard JSON does not allow single-quoted strings (use double quotes), a trailing comma after the last item, unquoted keys, comments (// or /* */), NaN, Infinity or undefined. Numbers cannot have leading zeros, and line breaks inside strings must be written as \n. Text copied from JavaScript code or config files most often hits these.

What Format and Minify produce

The Format button indents the JSON with 2 spaces, places each key-value pair and array item on its own line, and highlights keys, strings and numbers. The Minify button removes all extra whitespace and returns single-line JSON, which is useful for request parameters or smaller payloads. Both keep the original order of object keys and the original number text, so large integers are not rewritten.

Frequently asked questions

How do I check whether my JSON is valid?

Paste it and choose Format or Minify. If the JSON is invalid, the page shows Invalid JSON with the browser's error message, which usually points to the position or character that failed.

Is my pasted data uploaded?

No. Parsing and formatting run in your browser and nothing is sent to a server. Even so, avoid pasting passwords, tokens or other secrets into any web tool.

Does it support JSON with comments (JSONC or JSON5)?

No, it validates standard JSON (RFC 8259). Remove comments and trailing commas and change single quotes to double quotes before formatting.

Can it handle large JSON files?

Text up to a few megabytes usually works fine, depending on your device. Very large files can slow the page down; a command-line tool such as jq or an editor plugin is better for those.

JSON formatting

Supports standard JSON format. JSON data can be formatted (pretty indentation) or compressed (whitespace removed). Automatically detect and prompt syntax errors.

settings