JSON Formatter
Validate, format and minify JSON, with or without comments. Browse it as a tree, query it with JSONPath, compare two documents, check one against a JSON Schema, escape it into a string or export it as CSV.
Or drop a JSON file here, up to 2 MB. It isn't uploaded.
How to use this tool
Paste your JSON
Paste a raw API response, minified body, or hand-written JSON into the input field. The formatter parses it on every keystroke, so valid input updates the output instantly and invalid input shows the exact line and column of the first parse error.
Choose format or minify
Leave indentation on for a readable, prettified view with 2-space nesting, or toggle Minify to strip all whitespace into a single line for embedding in a URL, cookie, or compact API payload.
Read the structured output
The output pane shows the reformatted JSON in a readable text area. If parsing fails, the error message points to the first offending character so you can fix the input without guessing.
Query, compare or check a schema
Pick Query to pull values out with a JSONPath query like $.users[*].name, Compare to see what changed between two documents, or Schema to check the JSON against a JSON Schema. Each mode lists results with their exact paths.
Copy the result
Use the copy button to grab the formatted (or minified) output and paste it into your code, a curl command, or a config file. Parsing and reformatting happen locally, and the input stays out of the page URL.
About this tool
The JSON Formatter validates, beautifies, and minifies JSON locally in your browser. It also opens JSON as a collapsible tree, runs JSONPath queries, compares two documents, checks JSON against a JSON Schema, escapes text into a JSON string and exports an array of objects as CSV. Paste a raw API response and get indented, readable output, with parse errors shown by line and column.
The tool doesn't upload the payload for parsing. Your input stays out of the address bar too, so it won't show up in browser history or in a link you share unless you choose to include it.
Use it when JSON arrives as a single minified line and you need to read it, when you're writing JSON by hand and want to verify it parses before deploying, or when you want to shrink a bloated payload for embedding in a URL, cookie, or environment variable. Pretty-print for humans or minify for the wire, each in a single click on the same input.
What it does
Parses JSON according to RFC 8259 (strict JSON, so no trailing commas), reformats it with 2-space indentation, or strips every byte of whitespace for minified output. Allow comments reads JSONC and drops the comments from the output. Errors include the line and column of the first parse failure so you can fix the input fast.
Tree, query, compare and schema
- The tree view is for reading big nested responses one branch at a time.
- Query mode answers questions like which orders cost more than 100, with standard RFC 9535 JSONPath.
- Compare mode shows what an API change or a config edit did, without the noise of reordered keys.
- Schema mode tells you whether a payload fits its contract, with the failing path and the schema keyword for each problem.
All four read numbers by their written digits, so IDs and amounts past the JavaScript safe range stay correct.
Escape and CSV
- Escape mode turns text into a JSON string, for example to put a JSON document inside another JSON value. Unescape does the reverse.
- CSV mode turns an array of objects into rows and columns, with nested objects as dotted columns.
Both run in your browser, like the rest of the tool.
When to use it
Daily dev work: debugging API responses, preparing seed data, reviewing logs, or validating that a config file is well-formed before running a deploy. Pair with the Encoding Converter when the JSON is wrapped in Base64, and the Unix Timestamp tool when the payload contains epoch time values that need human translation.
Popular JSON scenarios
Guides to common JSON workflows and troubleshooting questions.
Frequently asked questions
How do I format a minified JSON string?
Why is my JSON invalid?
How do I minify JSON?
Is the JSON I paste sent to a server?
Can I format JSON5 or JSONC?
How do I browse JSON as a tree?
Which JSONPath syntax does the Query mode support?
How does Compare decide what changed?
Which JSON Schema versions can the Schema mode check?
Why do big numbers stay exact?
How do I escape JSON into a string?
How do I convert JSON to CSV?
What's the difference between a JSON object and array?
Related tools
Text Encoding Converter
Convert text to Base64, binary, hex, URL encoding and HTML entities, and back again.
Use toolUnix Timestamp
Convert between Unix timestamps and human-readable dates.
Use toolPassword Generator
Generate secure, random passwords locally in your browser.
Use toolContrast Checker
Check color contrast ratios for WCAG AA/AAA accessibility compliance.
Use toolUse this tool on your own site
Drop the JSON Formatter into your blog, docs, or CMS with one iframe snippet. Free, no signup. See all embeddable tools