{
    "mode": "man",
    "parameter": "JSON_PP",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/JSON_PP/1/json",
    "generated": "2026-10-22T13:24:50Z",
    "synopsis": "jsonpp [-v] [-f fromformat] [-t toformat] [-jsonopt optionstojson1[,optionstojson2[,...]]]",
    "sections": {
        "NAME": {
            "content": "jsonpp - JSON::PP command utility\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "jsonpp [-v] [-f fromformat] [-t toformat] [-jsonopt optionstojson1[,optionstojson2[,...]]]\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "jsonpp converts between some input and output formats (one of them is JSON).  This program\nwas copied from jsonxs and modified.\n\nThe default input format is json and the default output format is json with pretty option.\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "-f",
                    "content": "-f fromformat\n\nReads a data in the given format from STDIN.\n\nFormat types:\n\njson\nas JSON\n\neval\nas Perl code\n",
                    "flag": "-f"
                },
                {
                    "name": "-t",
                    "content": "Writes a data in the given format to STDOUT.\n\nnull\nno action.\n\njson\nas JSON\n\ndumper\nas Data::Dumper\n",
                    "flag": "-t"
                },
                {
                    "name": "-json_opt",
                    "content": "options to JSON::PP\n\nAcceptable options are:\n\nascii latin1 utf8 pretty indent spacebefore spaceafter relaxed canonical allownonref\nallowsinglequote allowbarekey allowbignum loose escapeslash indentlength\n\nMultiple options must be separated by commas:\n\nRight: -jsonopt pretty,canonical\n\nWrong: -jsonopt pretty -jsonopt canonical\n"
                },
                {
                    "name": "-v",
                    "content": "Verbose option, but currently no action in fact.\n",
                    "flag": "-v"
                },
                {
                    "name": "-V",
                    "content": "Prints version and exits.\n",
                    "flag": "-V"
                }
            ]
        },
        "EXAMPLES": {
            "content": "$ perl -e'print q|{\"foo\":\"あい\",\"bar\":1234567890000000000000000}|' |\\\njsonpp -f json -t dumper -jsonopt pretty,utf8,allowbignum\n\n$VAR1 = {\n'bar' => bless( {\n'value' => [\n'0000000',\n'0000000',\n'5678900',\n'1234'\n],\n'sign' => '+'\n}, 'Math::BigInt' ),\n'foo' => \"\\x{3042}\\x{3044}\"\n};\n\n$ perl -e'print q|{\"foo\":\"あい\",\"bar\":1234567890000000000000000}|' |\\\njsonpp -f json -t dumper -jsonopt pretty\n\n$VAR1 = {\n'bar' => '1234567890000000000000000',\n'foo' => \"\\x{e3}\\x{81}\\x{82}\\x{e3}\\x{81}\\x{84}\"\n};\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "JSON::PP, jsonxs\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Makamaka Hannyaharamitu, <makamaka[at]cpan.org>\n",
            "subsections": []
        },
        "COPYRIGHT AND LICENSE": {
            "content": "Copyright 2010 by Makamaka Hannyaharamitu\n\nThis  library is free software; you can redistribute it and/or modify it under the same terms\nas Perl itself.\n\nperl v5.38.2                                 2026-08-18                                   JSONPP(1)",
            "subsections": []
        }
    },
    "summary": "jsonpp - JSON::PP command utility",
    "flags": [
        {
            "flag": "-f",
            "long": null,
            "arg": null,
            "description": "-f fromformat Reads a data in the given format from STDIN. Format types: json as JSON eval as Perl code"
        },
        {
            "flag": "-t",
            "long": null,
            "arg": null,
            "description": "Writes a data in the given format to STDOUT. null no action. json as JSON dumper as Data::Dumper"
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "options to JSON::PP Acceptable options are: ascii latin1 utf8 pretty indent spacebefore spaceafter relaxed canonical allownonref allowsinglequote allowbarekey allowbignum loose escapeslash indentlength Multiple options must be separated by commas: Right: -jsonopt pretty,canonical Wrong: -jsonopt pretty -jsonopt canonical"
        },
        {
            "flag": "-v",
            "long": null,
            "arg": null,
            "description": "Verbose option, but currently no action in fact."
        },
        {
            "flag": "-V",
            "long": null,
            "arg": null,
            "description": "Prints version and exits."
        }
    ],
    "examples": [
        "$ perl -e'print q|{\"foo\":\"あい\",\"bar\":1234567890000000000000000}|' |\\",
        "jsonpp -f json -t dumper -jsonopt pretty,utf8,allowbignum",
        "$VAR1 = {",
        "'bar' => bless( {",
        "'value' => [",
        "'0000000',",
        "'0000000',",
        "'5678900',",
        "'1234'",
        "],",
        "'sign' => '+'",
        "}, 'Math::BigInt' ),",
        "'foo' => \"\\x{3042}\\x{3044}\"",
        "};",
        "$ perl -e'print q|{\"foo\":\"あい\",\"bar\":1234567890000000000000000}|' |\\",
        "jsonpp -f json -t dumper -jsonopt pretty",
        "$VAR1 = {",
        "'bar' => '1234567890000000000000000',",
        "'foo' => \"\\x{e3}\\x{81}\\x{82}\\x{e3}\\x{81}\\x{84}\"",
        "};"
    ],
    "see_also": [],
    "tldr": {
        "source": "cheatsh",
        "description": "",
        "examples": [
            {
                "description": "Pretty-print JSON data from a file",
                "command": "json_pp &lt; {{file}}"
            },
            {
                "description": "Pretty-print JSON data from a file and output to another file",
                "command": "json_pp &lt; {{file}} &gt; {{file}}"
            },
            {
                "description": "Pretty-print JSON data and read from a pipeline",
                "command": "cat {{file}} | json_pp"
            },
            {
                "description": "Pretty-print JSON data with sorted keys",
                "command": "json_pp -s &lt; {{file}}"
            },
            {
                "description": "Minimize JSON data (remove unnecessary whitespace)",
                "command": "json_pp -json_opt=canonical,space_before =&gt; {{file}}"
            },
            {
                "description": "Enable colored output for pretty-printed JSON",
                "command": "json_pp -json_opt=color &lt; {{file}}"
            }
        ]
    }
}