JSON / Data Toolkit
Paste JSON to validate it, pretty-print or minify it, sort keys, and see helpful parse errors — everything stays in your browser.
Runs locally in your browser
Input processed locally.
Discuss a result
Write a short summary and review it before posting. Your tool inputs are never copied automatically.
What is the JSON / Data Toolkit?
The JSON toolkit validates and reformats JSON. It can pretty-print with configurable indentation, minify, and optionally sort object keys.
How to use it
- 1Paste or type JSON into the editor.
- 2Choose format, minify or sort keys.
- 3Copy the result or read the error message.
How it works
The input is parsed with the browser’s native JSON parser. Valid data is re-serialized; invalid input produces a precise error message. Nothing is uploaded.
Limitations & notes
- Extremely large documents may be slow in the browser.
- Comments and trailing commas are not valid JSON.
Frequently asked questions
What are the most common reasons JSON fails to validate?
The usual culprits are a trailing comma after the last item, single quotes instead of double quotes around strings or keys, unquoted keys like {name: 1}, comments, and values such as NaN, undefined or Infinity that JavaScript allows but JSON does not. The error message comes from your browser's own parser and usually names the unexpected character and its position, which points you to the line to fix.
Can I convert JSON to CSV and back with this tool?
Yes. Choose JSON to CSV for an array of objects, such as [{"id":1,"name":"Ana"}]. Every key found in any object becomes a column, and missing values are left empty. CSV to JSON needs a comma-separated file with a header row, and every row must have the same number of columns. All values come back as strings, so 42 becomes "42" and you may need to convert numbers afterward.
What happens to nested objects when converting JSON to CSV?
This converter does not flatten nesting. A nested object in a cell is written as the text [object Object], and an array becomes its items joined by commas, wrapped in quotes. If your data looks like {"user":{"id":1}}, reshape it first to flat keys such as user_id, or extract the inner array, so each row only holds plain strings, numbers and booleans.
Why did a long number in my JSON change after formatting?
JavaScript stores JSON numbers as 64-bit floating point values, which are exact only up to 9,007,199,254,740,991. A larger ID such as 9007199254740993 is silently rounded to 9007199254740992 when parsed and printed again. Twitter-style snowflake IDs and some database keys hit this limit. APIs usually avoid the problem by sending large IDs as strings, which the formatter leaves untouched.
Does sorting keys change my data?
No values change, only key order. Sort keys orders object keys alphabetically at every nesting level but leaves array items in their original order, because array order carries meaning. Sorted output is useful before comparing two API responses in a diff tool, since identical data then lines up line by line. Note that if a key appears twice in one object, JSON parsing keeps only the last value.
No directly related discussion yet.
Start a focused thread and share the question this tool helped you explore.
Ask the community about JSON / Data Toolkit