JSON Formatter and Validator
Paste JSON to check it against the standard and lay it out cleanly. Errors show their line and column, and numbers stay exactly as typed.
Paste or type JSON, or open a .json file, up to 10 MB. It stays on this page: nothing is sent anywhere or saved.
Paste JSON above to check and format it.
Everything happens on this page, on your device: your JSON is never sent anywhere or saved.
Check JSON and make it readable
JSON is the text format most web services and config files use. One missing comma or stray quote makes a whole file unreadable to a program, and a long minified line is hard for a person to read. This tool checks the text against the JSON standard (RFC 8259) and lays it out cleanly, or squeezes it onto one line.
How to use it
- Paste or type your JSON, or open a .json file of up to 10 MB.
- Read the line under the options: a summary of what the JSON holds, or the first error, with its line and column.
- Choose a layout: 2 or 4 spaces, tabs, or minified onto one line. Tick Sort keys to put every object’s keys in order.
- Copy the result, or download it as a .json file.
Reading an error
The message names the line and column, says what should have come next, and shows the line with a caret (^) under the spot. “Show the error in the text” selects it in your text. The usual causes:
- a comma after the last item, as in [1, 2,];
- a missing comma between two items;
- single quotes, or curly quotes from a word processor, instead of straight double quotes;
- comments, which JSON doesn’t allow;
- True, None or NaN instead of true, null or a number.
Exact numbers and text
Many formatters read JSON with JavaScript’s JSON.parse and write it back out. That rounds whole numbers beyond about 9 quadrillion, so 12345678901234567890 becomes 12345678901234567000, and it rewrites escapes such as é. This tool keeps every number and string exactly as you typed it, and warns you when JavaScript code would round a number. It also points out keys repeated in the same object, which many programs quietly drop.
Good to know
- It doesn’t repair JSON for you, and it doesn’t check data against a JSON Schema.
- Sort keys orders keys by character code, so capitals come before lowercase letters. Arrays keep their order.
- Sizes are counted in bytes, as the text would be saved in a UTF-8 file.
- Everything runs on this page, on your device. Tokens, keys and customer data you paste aren’t sent anywhere or saved.
- Need a spreadsheet? JSON to CSV turns an array of objects into a table, and CSV to JSON goes the other way.