If you have a json file that needs formatting, you can use a built-in tool in Python.

<pre lang="bash">
python -m json.tool sample.json

Output will be printed on screen. You can also send the output to a file.

<pre lang="bash">
python -m json.tool sample.json > sample2.json