JSON Formatter & Validator
Format, validate and tidy JSON data.
Tree view
Click a node to see its path. Arrow keys move, Right and Left open and close nodes. Long arrays load 100 items at a time.
How to use the JSON toolkit
- Paste your JSON into the input area.
- Press Format to pretty-print it or Minify to compress it to one line.
- Use Validate to check the syntax and see the root type and byte size.
- Copy or download the processed result when you are done.
- Work on a copy of important data so formatting experiments never overwrite the original.
When it helps
- Pretty-printing a compact API response.
- Checking whether a configuration file contains valid JSON.
- Minifying payloads before pasting them into another system.
- Sorting object keys to make diffs easier to read.
- Preparing a JSON fixture file for automated tests.
How JSON is parsed and serialized
The toolkit uses the browser's JSON.parse and JSON.stringify functions, without a separate parsing library. Formatting uses two spaces by default (four spaces or a tab on request); To CSV turns an array of objects into rows and columns, with nested objects flattened to dotted column names; Tree view builds nodes only when you open them (long arrays load 100 items at a time), shows the JSONPath and JavaScript path of the node you click and searches keys and values; the byte counter measures a Blob made from the current text. Parsing first converts numbers to JavaScript Number values, so integers beyond the safe integer range can change. Repeated object keys keep their last value when the parsed object is serialized.
Example: a 29-byte JSON object
Enter { "items": [3, 1], "active": true } and choose Minify. The output is {"items":[3,1],"active":true}, with a byte count of 29 and an object root type. The two array elements remain 3 and 1. Spaces around punctuation disappear because serialization rebuilds the text from parsed values; the boolean true stays a boolean.
Frequently asked questions
Is my JSON sent to a server?
No. The text is parsed and formatted only in your browser and never leaves your device.
What are the limitations?
The toolkit works with standard JSON, so trailing commas, comments, and single quotes are rejected as invalid. Very large documents may slow down formatting.
What does the sort option do?
It reorders object keys alphabetically at every level, which can make version diffs of JSON files cleaner.
Does validation report the problem?
Yes. If the input is invalid, the status area says what is wrong and gives the line and column, and the cursor jumps to that spot in the input.
Can I save the formatted result?
Yes. The download button saves the output as a .json file, and the copy button puts it on the clipboard.
Can it handle nested objects and arrays?
Yes. Formatting, minifying, and sorting support nested objects and arrays, subject to the resources available in your browser. Sorting reorders keys at each level without changing values or array order. Validation checks the syntax of the whole document.