JSON Formatter & Validator
Runs in your browserFormat, validate and minify JSON in your browser, with the exact line and column of any syntax error.
Applies to formatted output.
Or press Ctrl/⌘ + Enter to format.
Input
Output
No output yet
Paste JSON on the left, then press Format. Validation happens at the same time.
Your data never leaves your device
This tool runs entirely in your browser. Nothing you enter is uploaded, stored or logged by BeeTools.
How to use the json formatter & validator
Paste your JSON
Drop the raw text into the input panel. It can be minified, badly indented or partially broken — anything goes.
Choose an indentation style
Two spaces suits most JavaScript projects; tabs are common in Go and Make-based repositories.
Format, minify or sort
Format pretty-prints and validates, Minify strips whitespace, and Sort keys normalises ordering. Ctrl/⌘ + Enter formats without reaching for the mouse.
Fix any reported error
If the document is invalid, jump to the reported line and column. Trailing commas and single-quoted strings are the two most common causes.
Copy or download the result
Copy puts the output on your clipboard; Download saves it as a .json file.
Features
Pretty-print with your indentation
Two spaces, four spaces or tabs. Switching re-formats the output immediately.
Precise error locations
Invalid JSON reports the line and column where parsing failed, not just that it failed.
Minify for production
Strip every optional byte of whitespace and see how much smaller the result is.
Structure at a glance
Byte size, line count, total keys and maximum nesting depth for the parsed document.
Safe for real payloads
Parsing happens in your browser, so tokens and customer data never leave your device.
Sort keys alphabetically
Normalise key order at every level to diff two payloads that differ only in ordering.
About this tool
A JSON formatter is the fastest way to make sense of a payload you have just pulled out of an API response or a log line. Paste the raw text, press Format, and you get properly indented output plus an immediate verdict on whether the document is actually valid JSON.
When something is wrong, a generic "parse error" is not much help. This tool reports the precise line and column where parsing stopped, which is usually within a character or two of the real mistake — a trailing comma, a single quote where a double quote belongs, or an unescaped newline inside a string.
Everything happens inside your browser using the same JSON parser your JavaScript runs on, so the validation you see here matches what your application will do. That also means you can safely paste production payloads, access tokens and customer data: none of it is transmitted anywhere.
- Pretty-print with your indentation. Two spaces, four spaces or tabs. Switching re-formats the output immediately.
- Precise error locations. Invalid JSON reports the line and column where parsing failed, not just that it failed.
- Minify for production. Strip every optional byte of whitespace and see how much smaller the result is.
- Structure at a glance. Byte size, line count, total keys and maximum nesting depth for the parsed document.
- Safe for real payloads. Parsing happens in your browser, so tokens and customer data never leave your device.
- Sort keys alphabetically. Normalise key order at every level to diff two payloads that differ only in ordering.
Frequently asked questions
Is my JSON uploaded to a server?
No. Formatting and validation both run in your browser using its built-in JSON parser. Nothing you paste is sent over the network, which is why this tool is safe to use with access tokens, internal API responses and customer records.
Why does my JSON fail to validate when it looks fine?
The three usual culprits are a trailing comma after the last item in an object or array, single quotes instead of double quotes around keys or strings, and comments — none of which the JSON specification allows, even though JavaScript and JSON5 accept them. The reported line and column will point you at the exact spot.
What is the difference between formatting and minifying?
Formatting adds newlines and indentation so a human can read the structure. Minifying removes every optional character so the document is as small as possible to transmit. Both produce semantically identical JSON — only the whitespace differs.
Does formatting change my data?
The structure and values are preserved, but the document is re-serialised from the parsed value, so number literals are normalised: 1.0 becomes 1 and 1e3 becomes 1000. Duplicate keys are also collapsed, keeping the last occurrence, which is what JavaScript itself does.
Is there a size limit?
There is no artificial limit, but very large documents — tens of megabytes — will be limited by your device’s memory and can make the browser feel slow while formatting. For files that big, a streaming command-line tool such as jq is a better fit.
Can it handle JSON Lines or NDJSON?
Not directly. JSON Lines files contain one independent JSON document per line, which is not itself valid JSON. You can format a single line at a time, or wrap the lines in an array with commas between them first.
Related tools
Tools that pair well with this one.
- Your data never leaves your device
Base64 Encoder & Decoder
Encode text to Base64 or decode it back, with full Unicode support and a URL-safe option.
- Your data never leaves your device
Word Counter
Count words, characters, sentences and paragraphs as you type, with reading time and word frequency.
- Your data never leaves your device
JWT Decoder
Decode a JSON Web Token to read its header, payload and expiry. Does not verify signatures.
- Your data never leaves your device
Unix Timestamp Converter
Convert Unix timestamps to dates and back, with the seconds-or-milliseconds question answered.