Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
JSON Format Tools

python -mjson.tool

curl '' -k -s | python -mjson.tool

To make it sorter, put an alias in your ~/.bash_profile, or ~/.config/fish/

alias json="python -m json.tool"

Then you can do:

curl '' -k -s | json

Bonus 1: After formatting, copy into clipboard:

curl '' -k -s | json | pbcopy

Bonus 2: Format from clipboard:

pbpaste | json

Bonus 3: Format from clipboard, then copy into clipboard:

pbpaste | json | pbcopy

Sublime Text: Use JsFormat plugin



  • Requires to set language type.

Visual Studio Code: Use Prettier Code Formatter



  • Requires to set language type.
  • Prettier has a bug: You have to save content into a file before it can be formatted.

Chrome Developer Tools

Right click on Network Response Preview > Store as global variable.


// Or maybe you prefer this:

JSON.stringify(temp1, null, 2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.