Formats
JSON Formatter
Format, validate, and minify JSON with syntax highlighting.
How to use it
- Open Devly from the wrench in your menu bar, or press ⌃⌥⌘D. Press ⌘P, type JSON Formatter and press Return.
- Paste or type your text into Input.
- Adjust the Options on the right if you need to. The defaults are listed below.
- Press Format, or ⌘↵.
- Use Copy or ⇧⌘C to copy the result. ⌘L clears everything.
Options
| Option | Values | Default |
|---|---|---|
| ModePretty print or minify JSON | Pretty, Minify, Compact | Pretty |
| Indent SpacesNumber of spaces for indentation | 1–8 | 2 |
| Sort keys alphabeticallySort object keys in alphabetical order | On or off | Off |
| Escape UnicodeEscape non-ASCII characters | On or off | Off |
| Strip comments (JSONC)Remove // and /* */ comments | On or off | On |
Example
Real output from Devly, with the default options.
Input
{"name":"Devly","version":"2.3.0","tools":65,"offline":true,"price":"$4.99 once","categories":["Encoding","Hashing","Formats","Web Dev","Text","Dev Utils","Graphics"]}{
"offline" : true,
"price" : "$4.99 once",
"categories" : [
"Encoding",
"Hashing",
"Formats",
"Web Dev",
"Text",
"Dev Utils",
"Graphics"
],
"name" : "Devly",
"tools" : 65,
"version" : "2.3.0"
}From Terminal
With the free command-line tool installed:
Terminal
devly jsonformat --path input.txt # or pipe text in pbpaste | devly jsonformat
Quick Switch also finds it by: json, format, validate, pretty, minify, beautify.
More Formats tools
JSON Path QueryQuery JSON data using JSONPath expressionsJSON ↔ YAMLConvert between JSON and YAML formatsYAML FormatterFormat, validate, and beautify YAML documentsXML FormatterFormat, validate, and beautify XML documentsXML ↔ JSONConvert between XML and JSON formatsCSV → JSONConvert CSV data to JSON format