Home > python > Prettify a JSON file

Prettify a JSON file

You want to make a JSON file (string) human-readable.


curl -s http://www.reddit.com/r/nsfw/.json | python -mjson.tool

For some more alternatives please refer to this post.

Update (20121021)
Another way is to use jq, a powerful command-line tool for querying JSON files.

Categories: python Tags: , , ,
  1. spreadsheetpro
    November 10, 2014 at 15:37

    I normally use python too, but sometimes it’s easier to copy paste. I made tool where you can paste your JSON and it will pretty print it, might be useful for your readers too: http://www.jsonprettyprint.net

  1. No trackbacks yet.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: