JSON Formatter Format, validate and minify JSON

Paste JSON to format it, find syntax errors or inspect its structure. Large numbers keep every digit.

What’s in your JSON?

Choose indentation and key sorting, then press Format or Minify.

    Your JSON never leaves this page. Formatting runs in your browser.

    How to format JSON

    Paste or open a file

    Paste your text into JSON input, or use Open file to read a local .json or .txt file. Choose two spaces, four spaces or a tab for indentation, then press Format. Sample gives you a small object to try. Copy puts the current output on your clipboard; Download saves it as formatted.json.

    Inspect its structure

    Tree view shows objects, arrays and their children with type labels and item counts. Open a node to inspect it, or use Expand all and Collapse all. For more than 5,000 value nodes, the page skips the tree preview and explains why. The text output still contains the complete value.

    This formatter preserves number literals such as 12345678901234567890, 1.0 and 1e5 without converting them to JavaScript numbers. String escapes are preserved too.

    What’s wrong with my JSON?

    Commas and quotes

    A trailing comma such as [1,2,] needs to become [1,2]. A missing comma such as [1 2] needs to become [1,2]. Use double quotes for property names and strings: {'name':'Sam'} becomes {"name":"Sam"}.

    Keys and comments

    An unquoted name such as {name:1} needs quotes: {"name":1}. Strict JSON does not allow // comments or /* comments */; remove them before formatting. The error explains the cause, gives a line and column, highlights that line below the input and places the caret at the error.

    Brackets and values

    An unfinished {"a":1 needs a closing brace: {"a":1}. The message identifies where the unclosed container began. NaN, Infinity and undefined are not JSON values. Use a finite number, null or a quoted string according to what your data actually means.

    Strings and extra text

    A literal line break inside a string must be written as the escape \n. Keep only one top-level JSON value: {} {} is not one JSON document. Repeated property names trigger a warning because different consumers may interpret them differently.

    What is a JSON file?

    Text that represents data

    JSON is a text format for structured data, defined in RFC 8259. Objects contain named properties, arrays contain ordered values, and individual values can be strings, numbers, booleans or null. Applications use JSON to exchange data and store configuration.

    Readable when formatted

    A JSON file can be opened in a text editor. Indentation and line breaks help people read it, while applications use the structure rather than the visual layout. If a file will not open here, make sure it contains JSON text rather than a binary file or another format.

    What is the difference between formatting and minifying JSON?

    Formatting adds indentation and line breaks outside strings. Minifying removes that unnecessary whitespace to make the text shorter. Neither operation changes whitespace inside a string or rewrites number literals. Key sorting is optional and applies within objects; array order stays the same.

    Inputs over 5 MB show a notice but remain available for formatting. Processing time depends on your device. The parser supports up to 512 nested containers and gives an explicit message beyond that limit.

    JSON formatter FAQ

    Is my data uploaded?

    No. Pasting, file reading, formatting, validation and downloading take place in your browser. The tool does not upload your JSON or save it in browser storage.

    How do I open a JSON file?

    Use Open file and choose a .json or .txt file from your device. The file is read locally. You can also open a JSON file in a text editor and paste its contents here.

    Is JSON human readable?

    Yes, it is text. Formatting makes a compact document easier to read by showing indentation and line breaks. Very large or deeply nested documents can still be difficult to follow.

    What is JSONC?

    JSONC is a JSON-like format that permits comments. This page validates strict JSON, so comments are rejected with an explanation instead of being silently removed.

    Why does sorting keys not change the values?

    The formatter reorders object properties without rewriting their values or changing array order. JSON objects are unordered in the format, but some applications depend on the order they receive. Avoid sorting in that case. Duplicate names are preserved and warned about; consumers may interpret them differently.

    Does formatting round large numbers?

    No. Number tokens are kept exactly as entered, including large integers, decimal zeros and exponent notation. A receiving application may still round them when it reads the formatted text.