JSON Formatter
Format, validate and inspect JSON.
Runs in your browser Runs entirely in your browser. Nothing you put in it ever leaves your device.
Paste or type JSON. Press Command or Control and Enter to format it.
Ready. Nothing is sent anywhere.
⌘/Ctrl + ⏎ format ⌘/Ctrl + S download
Was this useful?
About this tool
Paste or drop a JSON file to pretty-print it, minify it, or find out exactly where it breaks. Errors are reported with a line and column so you can fix them without counting brackets by hand.
How to use it
- Paste your JSON into the editor, or drop a .json file onto it.
- Press Format to pretty-print it, or Minify to strip whitespace.
- If the JSON is invalid, use “Jump to error” to place your cursor on the problem.
- Copy the result or download it as a file.
Supported input
- .json
- .jsonc (comments are reported as errors)
- .txt
- pasted text
Privacy
Runs entirely in your browser. Nothing you put in it ever leaves your device. Everything happens in JavaScript on this page, so the tool keeps working even if you go offline after it has loaded — which is the simplest way to see for yourself that nothing is being sent. Read the full privacy information.
Questions
Is my JSON uploaded anywhere?
No. Formatting, minifying and validation all happen in your browser using JavaScript. Nothing is sent to our server, and the tool keeps working if you go offline after the page has loaded.
How large a file can it handle?
That depends on your device rather than on us. Files up to a few tens of megabytes are usually fine on a desktop browser; very large files may take a moment to format.
Why does it reject my JSON when my editor accepts it?
Strict JSON does not allow comments, trailing commas, single-quoted strings, or unquoted keys. Many editors accept those as “JSON with comments”. The error message tells you which rule was broken.
Can I sort the keys?
Yes. Turn on “Sort keys” before formatting and every object is rewritten with its keys in alphabetical order, which makes two versions of the same document easy to diff.
Related tools
-
JSON to CSV
Turn JSON into a spreadsheet-ready CSV file.
Stays on your device
-
JSON to TypeScript
Generate TypeScript interfaces from a JSON sample.
Stays on your device
-
JSON to YAML
Convert JSON into readable YAML.
Stays on your device
-
JSON to JSON Schema
Infer a JSON Schema from a sample document.
Stays on your device