utilapp.net

JSON Formatter & Validator

Format, validate, and minify JSON data with syntax highlighting. Debug API responses and configuration files with ease.

Input

Output

How to Format and Validate JSON

  1. 1

    Paste your JSON

    Copy your JSON data and paste it into the input field on the left.

  2. 2

    View validation status

    Check the status indicator to see if your JSON is valid or has errors.

  3. 3

    Choose output format

    Click 'Format' for pretty-printed output or 'Minify' for compressed output.

  4. 4

    Adjust indentation

    Select your preferred indentation (2, 3, or 4 spaces) using the dropdown.

  5. 5

    Copy the result

    Click the copy button to copy the formatted JSON to your clipboard.

Working with JSON: what the formatter checks

What counts as valid

This page parses your text with the browser's own JSON.parse, so it accepts exactly what the JSON standard (RFC 8259) allows and nothing more. Keys and strings need double quotes, trailing commas are errors, and comments are not part of JSON. A value such as undefined, NaN or a bare single-quoted string will be rejected, even though JavaScript object literals allow some of them.

Fixing the usual errors

Most failures come from a short list. A trailing comma after the last item, single quotes copied from a JavaScript or Python dict, an unquoted key, a missing comma between two items, or a raw line break inside a string (it must be written as \n). The error message names the character position where the parser gave up. The real mistake is often just before it, so look at the line above.

Format, minify and indentation

Format re-prints the parsed data with 2, 3 or 4 spaces per level. Minify prints it with no whitespace at all, which is what you want for a request body, a config value in an environment variable or a QR code. Both keep key order and array order. Duplicate keys are collapsed the way JSON.parse does it, so the last value wins.

Numbers and large integers

JSON numbers are parsed as JavaScript doubles. Integers beyond 9007199254740991 (2 to the 53rd power, minus 1) lose precision, so an ID such as 9007199254740993 comes back as 9007199254740992. If you work with 64-bit IDs, keep them as strings in the source data. Nothing you paste leaves this tab; the work is done by your browser.

Frequently Asked Questions