JSON Formatter & Validator
Format, validate and minify JSON online with clear error messages pointing at the failing line.
Paste some JSON to format.
How it works
Your input is parsed with the browser's native JSON parser — the same strict parser JavaScript itself uses. If it parses, it is re-serialized with your chosen indentation (2 spaces, 4 spaces, or minified to a single line). If it fails, the parser's error is translated into a message with the line number so you can jump straight to the problem.
Example
Paste an API response like {"user":{"id":42,"roles":["admin","dev"]}} and Pretty (2 spaces) expands it into a readable tree. A trailing comma or missing quote instead produces "Invalid JSON at line N" with the parser's reason.
Frequently asked questions
Is my JSON sent to a server?
No. Parsing and formatting happen entirely in your browser — safe for API keys and private payloads.
Does it accept comments or trailing commas?
No — it validates strict JSON (RFC 8259), which is exactly what APIs and parsers accept. JSON5 extensions are reported as errors.
What is the size limit?
Whatever your browser handles — multi-megabyte files format fine; extremely large ones may be slow.
What does Minify do?
It removes all whitespace, producing the smallest valid representation — useful for embedding JSON in configs or URLs.
Related tools
Pretty-print and validate XML with clean indentation — configs, SOAP payloads, sitemaps, RSS.
Base64 Encoder / DecoderEncode text to Base64 or decode Base64 back to text — Unicode-safe, entirely in your browser.
Markdown PreviewerLive side-by-side Markdown editor and preview — headings, lists, links, code and tables.