Best way to format large JSON file? (~30 mb)

jsonpps is the only one worked for me (https://github.com/bazaarvoice/jsonpps).
It doesn't load everything to RAM unlike jq, jsonpp and others that I tried.

Some useful tips regarding installation and usage:

Download url: https://repo1.maven.org/maven2/com/bazaarvoice/jsonpps/jsonpps/1.1/jsonpps-1.1.jar

Shortcut (for Windows):

  1. Create file jsonpps.cmd in the same directory with the following content:
    @echo off java -Xms64m -Xmx64m -jar %~dp0\jsonpps-1.1.jar %*

Shortcut usage examples:

  1. Format stdin to stdout:
    echo { "x": 1 } | jsonpps
  2. Format stdin to file
    echo { "x": 1 } | jsonpps -o output.json
  3. Format file to file:
    jsonpps input.json -o output.json

With python >= 2.6 you can do the following:

For Mac/Linux users:

cat ugly.json | python -mjson.tool > pretty.json

For Windows users (thanks to the comment from dnk.nitro):

type ugly.json | python -mjson.tool > pretty.json

jq can format or beautify a ~100MB JSON file in a few seconds:

jq '.' myLargeUnformattedFile.json > myLargeBeautifiedFile.json

The command above will beautify a single-line ~120MB file in ~10 seconds, and jq gives you a lot of json manipulation capabilities beyond simple formatting, see their tutorials.