JSON Formatter and Validator
Processed entirely in your browser. Nothing you paste is uploaded to a server.
You can also drop a .json file anywhere on the box above to load it.
This tool re-indents JSON so it is readable, strips whitespace when you need it compact, and tells you exactly where a broken document breaks. Paste your JSON in the box, then use Format, Minify, or Validate. Nothing is sent anywhere, the parsing happens in this tab.
What each button does
- Format parses the JSON and rewrites it with the indent you picked, one property per line.
- Minify parses it and writes it back with all optional whitespace removed, which is what you want before putting JSON in a config value or a request body.
- Validate parses without changing your text, and reports the line and column of the first problem it finds.
Reading the error message
A parse error names the character position where the document stopped making sense, which is not always where the mistake is. A missing closing bracket, for example, is usually reported at the next token, one or more lines later. Start at the reported line and column, then look upward for the unclosed bracket, brace, or quote.
The three most common causes are a trailing comma before a closing brace or bracket, a missing comma between two entries, and single quotes where JSON requires double quotes.
Two things formatting can quietly change
Formatting round-trips your document through a real parser, so it is not purely cosmetic. Duplicate keys in the same object collapse to the last one that appears. And numbers are parsed as doubles, so an integer larger than roughly 9 quadrillion, or a decimal with more significant digits than a double holds, comes back rounded. If either applies to your data, validate rather than format.
FAQ
Do I have to upload a file?
Does it tell me where the error is?
Does formatting change my data?
Will it accept JSON with comments or trailing commas?
Is there a size limit?
Need this JSON as a table? Use JSON to CSV. Coming from a spreadsheet instead? Use Excel to JSON or CSV to JSON.
Deciding which format to store your data in? Read CSV vs JSON: Which One Do You Need?
Advertisement
Ads help keep Kit-Bin free.