JSON Formatter, Pretty Printer & Repair Tool

Format, pretty-print, and repair JSON online from pasted text, files, or URLs with configurable indentation and clear syntax diagnostics. Read more

Format JSON online

This online JSON formatter parses compact or inconsistently indented JSON and writes it back with predictable whitespace. Paste JSON, open or drop a local file, or load a URL, then choose spaces or tabs and the indentation width. The pretty-printed result is easier to inspect, review, download, or paste into documentation.

Formatting valid JSON changes whitespace outside string values. It does not rename properties, sort keys, convert data types, or change whitespace that belongs inside a quoted string. Repair Invalid JSON can attempt fixes for common syntax mistakes while keeping the original input visible for comparison.

How to beautify JSON

  1. Paste JSON into the input editor, drop a local file, open a file, or load JSON from a URL.
  2. Select spaces or tabs and choose the indentation amount.
  3. Leave Repair Invalid JSON enabled when malformed input should be repaired when possible.
  4. Click Format to parse and beautify the document.
  5. Review syntax diagnostics, then copy or download the formatted output.

For example, {"name":"Ada","active":true} becomes a multi-line object with each property indented. The parsed values remain the string "Ada" and the Boolean true.

JSON syntax reminders

JSON is a text-based data interchange format standardized by RFC 8259. Object member names and string values use double quotes. Arrays and objects may be nested, but trailing commas and comments are not part of standard JSON.

JSON numbers do not use quotes. The literals true, false, and null are lowercase. Input that cannot be parsed or repaired produces an error instead of a partial result.

Repair invalid JSON

The repair option can handle many common mistakes, including trailing commas, missing quotes around property names, single-quoted strings, comments, and incomplete brackets. Diagnostics remain attached to the original input so you can select an issue and inspect its location, while the repaired JSON appears separately in Output.

Automatic repair is a convenience, not a guarantee that the result matches the author’s intent. Review the output before using it in an application, configuration file, or API request.

JSON formatter FAQ

Does formatting change the JSON data?

The object, array, and primitive values stay equivalent after a successful parse and format operation. Whitespace outside strings changes, and an application’s treatment of duplicate object names may still vary.

Can this format JavaScript object literals?

Only when the input is valid JSON or the repair option can convert its common JavaScript-like syntax. Functions, undefined, computed properties, and other executable JavaScript are not JSON and may still be rejected.

How do I make JSON smaller?

Use the JSON Minifier to remove unnecessary whitespace rather than add indentation. To check syntax without reformatting the document, use the JSON Validator.

Input
Information
Output
Settings