Quick answer: Paste your JSON into the box above. The tool checks it straight away and shows it neatly formatted. If something is wrong, it tells you the line and column. You can also minify it, repair common mistakes, browse it as a tree, search it with a path, or convert it to CSV or YAML. It all runs in your browser.
What this JSON formatter does
JSON is the format most websites and apps use to send data to each other. It is easy for computers to read, but a single long line of it is painful for people. This tool turns that wall of text into a clean, indented layout, and tells you whether the JSON is actually valid.
Beyond formatting, it gives you the tools developers reach for every day: a repair option for common mistakes, a collapsible tree, a path query box, key sorting, and one-click conversion to CSV or YAML. It is free, needs no signup, and has no size limit other than what your device can handle.
How to use it
- Add your JSON. Paste it, upload a
.jsonfile, or drag a file into the input box. You can click Sample to try it with example data. - Check the status. A green badge means the JSON is valid. A red one means there is an error, and the message shows where it is.
- Pick a view. Use the tabs on the right: Formatted, Minified, Tree, Query, CSV or YAML.
- Adjust the layout. Choose 2 spaces, 4 spaces or a tab for indentation, and turn on "Sort keys A to Z" if you want alphabetical order.
- Fix mistakes. If the JSON is invalid, click Go to error or try Auto-repair.
- Take it with you. Copy the result, download it as a file, or press Use as input to keep working on it.
What valid JSON looks like
JSON stands for JavaScript Object Notation. It is defined by open standards (RFC 8259 and ECMA-404) and it is built from just a few pieces. An object is a set of key and value pairs inside curly braces. An array is an ordered list inside square brackets. Values can be strings, numbers, true or false, or null.
The most common JSON mistakes
JSON is stricter than it looks. Code that works fine in a programming language often fails as JSON. These four mistakes cause most of the errors people see.
Other errors you may see
- Unexpected end of JSON input. Usually a missing closing bracket or brace, or the text was cut off when you copied it.
- Unexpected token. A character appears where JSON does not allow it. Look at the exact line and column the tool shows.
- Missing comma. Two values or pairs sit next to each other with nothing between them.
- Bad control character in a string. A real line break or tab was typed inside a string. In JSON it must be written as
\nor\t.
The exact wording of these messages depends on your browser, because the tool shows the message your browser gives. The line and column are what matter most.
Formatted or minified: which to use?
| View | Best for | Why |
|---|---|---|
| Formatted | Reading, debugging, config files, code reviews | Indentation makes the structure easy to follow. |
| Minified | API responses, storage, sending over a network | Removes extra spaces and line breaks, so the file is smaller. |
The tool shows both the original size and the minified size at the bottom, so you can see how much you would save.
Tree view and path queries
The Tree tab shows your JSON as folders you can open and close, which is much easier than scrolling through a big file. Click any key to copy its path, such as $.tools[0].name, and use "Expand all" or "Collapse all" to move quickly.
The Query tab lets you pull out part of the data by typing a path. Here are examples using the built-in sample.
| Path | What it returns |
|---|---|
$.site | The value of the site key |
$.tools[0].name | The name of the first tool in the list |
$.tools[*].name | The names of all tools |
$..name | Every name key anywhere in the data |
$.contact.email | A value inside a nested object |
The query box supports a practical subset of JSONPath: keys, array positions, wildcards and a search-everywhere option. It does not support filters or functions.
Converting JSON to CSV and YAML
CSV works best when your JSON is a list of similar objects, such as rows from a database. Each key becomes a column. If the data is nested, the tool flattens it using dotted column names like contact.email and tags[0]. The downloaded CSV includes a marker that helps Excel read non-English text correctly.
YAML is a more human-friendly way to write the same data, and it is popular for configuration files. The tool produces a clean, simple YAML version you can copy straight into a config.
| Format | Best for | Keep in mind |
|---|---|---|
| JSON | APIs, web apps, data exchange | Strict rules, no comments. |
| YAML | Config files that people edit by hand | Indentation matters, and mistakes are easy to make. |
| CSV | Spreadsheets and flat tables | Cannot show nested data without flattening it. |
Practical tips for working with JSON
Validate before you send or commit
A single missing comma can break an API request or a build. Paste your JSON here first. It takes a second.
Sort keys when comparing files
Two JSON files can hold the same data in a different key order. Sorting both alphabetically makes them much easier to compare.
Store long IDs as strings
JavaScript can only hold whole numbers exactly up to about 15 digits. Very long IDs, such as some order or account numbers, are safer as strings. The tool warns you when it sees very large numbers.
Use clear, consistent key names
Pick one style, such as camelCase or snake_case, and keep to it across the whole file.
Things this tool cannot do
Here are the limits, so the output never surprises you.
- Duplicate keys are merged. If the same key appears twice in one object, the browser keeps only the last one. This is how standard JSON parsing works.
- Comments are dropped. JSON does not allow comments. When you repair or format, any comments are removed.
- Large numbers can lose precision. Numbers above about 15 digits may be rounded in the output.
- Repair is a best guess. It fixes the common problems listed above. It cannot guess missing commas, missing brackets or text that was cut off, so always read the result.
- It does not check a schema. The tool tells you whether your JSON is valid, not whether it has the fields your app expects.
- Very large files depend on your device. A file of many megabytes may be slow on a phone. The tree opens branches only when you click them to keep things fast.
- Error positions vary by browser. Some browsers, such as Safari, do not report the line and column, so only the message is shown.
Your data stays private
Your JSON is processed entirely in your browser. It is not uploaded to our servers, and the tool does not save it. When you refresh the page, the input is gone. The tool does not load any outside code, so once the page has opened it can work without sending your data anywhere.
Even so, it is a good habit to avoid pasting live passwords, API keys or private customer data into any online tool you do not fully trust. Replace sensitive values with dummy ones first.
Frequently asked questions
How do I format JSON online?
Paste your JSON into the input box. The formatted version appears on the right straight away, indented with 2 spaces, 4 spaces or a tab, whichever you choose.
How do I check if my JSON is valid?
Paste it in and look at the badge under the editor. Green means valid. Red means there is an error, and the tool shows the line and column where it was found.
Why does my JSON say "Unexpected token"?
A character appears where JSON does not allow it. Common causes are single quotes, a trailing comma, an unquoted key or a comment. Click Go to error, or try Auto-repair.
What is the difference between formatting and minifying JSON?
Formatting adds line breaks and indentation so people can read it. Minifying removes them so the file is as small as possible. The data stays the same either way.
Can I convert JSON to CSV?
Yes. Open the CSV tab. A list of objects becomes rows and columns. Nested data is flattened into dotted column names, and you can download the result as a .csv file.
Does the tool send my JSON to a server?
No. Everything runs in your browser, and your input is not saved. Refreshing the page clears it.
Can JSON have comments?
No. Standard JSON does not allow comments. If you need them, use a format like YAML, or add a regular key such as "note" to hold the text.
How do I find one value inside a big JSON file?
Use the Query tab and type a path, such as $.users[0].email. Or use the Tree tab, open the branches, and click a key to copy its path.
Is this JSON formatter free?
Yes. There is no signup and no limit on how many times you use it. The site may show ads, which cover its running costs.
More tools
Hi, I’m Waqas, the person behind Brivonto. I started this site because I wanted online tools that simply work, without sign-ups or watermarks. I build each tool myself and keep improving them based on your feedback. Questions or feedback?

