MaisTools
Developer/

JSON Formatter

Format, validate, and minify JSON directly in your browser.

Indent

JSON Input
Output
Formatted output will appear here

About this tool

Formats, validates, and minifies JSON. Detects syntax errors and shows the position of the failure. Useful for making readable JSON copied from logs or APIs (which usually comes on a single line), preparing data to paste into code, checking that a config file is well-formed, or compacting a JSON for transmission (minify).

How to use

  1. Paste JSON in the input box.
  2. Pick the action: format with indentation or minify to one line.
  3. If there's an error, see the message and approximate position.
  4. Copy the formatted or minified result.

Frequently asked questions

What kinds of errors are detected?
Missing quotes, extra or missing commas, unbalanced braces and brackets, disallowed values (like undefined), comments (which pure JSON doesn't support), and keys without quotes (JSON always requires double quotes). The error message indicates the position where the problem was found.
What's the difference between format and minify?
Format adds line breaks and indentation for human readability, making the file larger but easier to read. Minify removes all non-essential whitespace, leaving JSON in its most compact form, ideal for network transmission or efficient storage.
Does it support JSON with comments?
Pure JSON (RFC 8259) doesn't allow comments. Variants like JSONC (JSON with Comments) used in some config files accept // and /* */. This tool validates pure JSON, so comments cause errors. Remove them before validating, or use a different format like YAML if you need comments.