JSON Formatter & Validator
Format JSON locally in your browser.
Format JSON locally in your browser.
Minified API responses, log lines, and config files are hard to read when everything sits on one line. Paste the text into the box, press Format & validate, and you get the same data pretty-printed with two-space indentation, one property per line, so nested objects and arrays are easy to follow.
Formatting is done by parsing the input and then writing it out again. That means the tool is also a strict check: if the text is not valid JSON, you see the message from the browser's own parser, which usually points to the unexpected character or position. This page is aimed at making data readable. If you only need a quick pass or fail answer, the separate JSON Validator is the shorter route.
Because the data is rewritten rather than just re-spaced, a few things can differ from your original. Very large integers can lose precision, and keys that look like whole numbers can move to the front of an object. Most everyday payloads are unaffected, but it is worth knowing before you paste the result back into production.
You copied a one-line response from a network panel or a curl command. Formatting it reveals the structure, so you can find the field you need, spot missing properties, and see how deeply the data is nested.
A package manifest, settings file, or fixture was edited by hand and has inconsistent spacing. Format it to produce uniform two-space indentation, which makes diffs in version control smaller and easier to review.
A deployment fails with a vague parse error. Paste the file here and read the message from the parser, then look near the reported position for a missing comma, a stray quote, or an unfinished bracket.
Before putting a payload into a ticket, README, or tutorial, format it so readers can scan it. Remove any real tokens, emails, or personal data first, since the output is meant to be copied around.
Parsing and formatting happen in your browser. The JSON you paste is not sent to a server by this tool.
Paste the single-line text into the input box and press Format & validate. The tool parses it and prints it again with line breaks and two-space indentation, so each property sits on its own line and nested objects and arrays are visibly indented.
The text broke a JSON rule. Typical causes are single quotes, a trailing comma after the last item, unquoted keys, comments, or a missing bracket. The message after the label comes from the browser's parser and often names the unexpected token and where it was found.
The values stay the same for ordinary data, but the text is rewritten. Spacing and line breaks are replaced, large integers beyond the safe range can lose digits, duplicate keys keep only the last value, and keys that are whole numbers may be listed first.
Not in this tool. Output always uses two spaces per level. If you need another style, copy the result into your editor and use its reformatting command, or adjust the indentation with a find-and-replace on the leading spaces.
No. Comments are not part of standard JSON, so the parser rejects them. Files such as some editor settings allow comments in a relaxed variant. Remove the comment lines first, then paste the remaining content to format it here.
The parsing runs in your browser and the text is not sent to a server by this tool. Still, responses can include tokens, emails, or personal data, so remove sensitive values before sharing the formatted output with others.