JSON Formatter
Makes JSON readable and points out its errors.
This tool runs on JavaScript. To use it, turn on JavaScript in your browser and reload the page.
MAKE A TANGLED JSON READABLE.
The JSON Formatter makes a JSON that has been squeezed onto one line or left untidy readable, and at the same time checks whether it is valid. The indentation can be 2 spaces, 4 spaces or a tab. “Sort keys alphabetically” makes comparing two JSON files easier; even if the same data arrives in a different order, the output is the same. “Squeeze onto one line” does the opposite: it drops the spaces and brings the file down to its smallest form, ready to embed in a configuration or a request. For broken JSON written by hand or copied from JavaScript/Python, the repair option fixes trailing commas, single quotes, comments, unquoted keys and True/False/None on its own; JSON embedded with escapes in a log line opens with a single option too.
If the file is broken, the tool does not just say “invalid JSON”: it shows which line and column the error is on, what was expected and the line itself. A forgotten comma, an extra comma, a single quote or an unclosed bracket is found in seconds that way. Turkish and other Unicode characters are written as they are, without being turned into escape codes. JSON, TXT and LOG files can be uploaded, up to 32 MB. It is used to look through API responses, tidy configuration files and debug. You can upload up to 20 files at once; they are all processed with the same settings, and several files download as a single ZIP.
From start to finish
- Upload your JSON file. Drag a JSON, TXT or LOG file in or select it.
- Choose the format. 2-space indentation to read it; key sorting to compare; one line to embed.
- Format and download. If it is valid, download the formatted file. If there is an error, fix it using the line and column details and try again.
Frequently asked questions
What do the line and column in the error message mean?
The place where the reader got stuck. The error is usually right there or just before it: a missing comma or an unclosed quote on the previous line is the most common cause.
Are comment lines (// or /* */) supported?
Standard JSON has no comments; with repair off, a file with comments gives an error. With “Try to repair broken JSON” on, // and /* */ comments are removed, and the result shows how many were removed.
Does sorting the keys change the data?
No. Only the order of the keys inside objects changes; the values and the order of arrays stay the same.
Does my file stay on the server?
No. Your file reaches the server only to be processed and is deleted when the job is done; the output is deleted too once you download it and leave the tool. You don't need an account, a name or an email address, and your files are never sent to a third-party service. It is free to use: we set no hourly or daily quota on the number of jobs, we don't make you watch an ad before processing, and we add no watermark to the output.
Other File tools
RUPO Studio