Paste JSON to pretty-print it with 2 spaces, 4 spaces or tabs, minify it, or sort its keys. Validation uses your browser's own JSON.parse (RFC 8259): invalid input shows the first error's exact line and column, valid input shows the key count and byte size. You can also drop in a file. Nothing leaves this tab.
InputDrop a .json file or paste
1
2
3
4
5
6
7
8
9
10
Output
Formatted JSON will appear here. Press Format, or Cmd / Ctrl + Enter.
Valid JSON7 keys·10 lines·151 B·Validated on this device
A JSON formatter pretty-prints compact or minified JSON, minifies it back, and reports syntax errors with a line and column. Use it for API payloads, config files and copy-paste blobs that need to be readable. Some people call the same thing a JSON beautifier, or say they want to prettify JSON; whatever the name, it is one operation: parse, then re-serialize with indentation.
How the JSON Formatter works
Paste JSON, drop a .json file, or load the sample. Format rewrites with the indent you pick: 2 spaces (default), 4 spaces or tabs. Minify removes whitespace. Sort keys orders object keys alphabetically. The status bar shows the key count and UTF-8 byte size when the document is valid, or the exact line and column when it is not. Validation uses your browser's JSON.parse, no network request.
~/faq
Frequently asked questions
Does the JSON formatter upload my data?
No. Parsing, formatting and validation run in this tab with the browser's JSON.parse. LocalFirstTools has no upload endpoint; the text you paste is never sent.
How do I fix an Unexpected token error?
The status bar points at the line and column of the first syntax problem, a trailing comma, a missing quote, or a comment. JSON does not allow comments or trailing commas; remove them and format again.
What is the difference between format and minify?
Format (pretty-print) adds indentation and line breaks so people can read the document. Minify emits a single compact line, which is smaller to copy into logs or requests.
Can I format JSON with comments?
Standard JSON cannot contain comments. If your file uses // or /* */ it is JSONC, not JSON. Strip comments first, then format.
How do I pretty print JSON?
Paste the JSON into the input pane and press Format (or Cmd/Ctrl + Enter). Pick 2 spaces, 4 spaces or tabs in the Indent selector first; 2 spaces is the default and matches what jq and Prettier emit.
What is the difference between a JSON formatter and a JSON beautifier?
None. Formatter, beautifier, prettifier and pretty-printer are different names for the same operation: parse the text, then write it back with indentation and one key per line. The values are untouched.
Is this JSON formatter really in-browser?
Yes. Open your browser's developer tools, switch to the Network tab and press Format: no request carries the text. Parsing, formatting and validation are plain JavaScript running in this tab.
Related tools
Chosen for the same job, not just the same category.