{
    "mode": "man",
    "parameter": "basenc",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/basenc/1/json",
    "generated": "2026-06-15T13:57:44Z",
    "synopsis": "basenc [OPTION]... [FILE]",
    "sections": {
        "NAME": {
            "content": "basenc - Encode/decode data and print to standard output\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "basenc [OPTION]... [FILE]\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "basenc encode or decode FILE, or standard input, to standard output.\n\nWith no FILE, or when FILE is -, read standard input.\n\nMandatory arguments to long options are mandatory for short options too.\n",
            "subsections": [
                {
                    "name": "--base64",
                    "content": "same as 'base64' program (RFC4648 section 4)\n",
                    "long": "--base64"
                },
                {
                    "name": "--base64url",
                    "content": "file- and url-safe base64 (RFC4648 section 5)\n",
                    "long": "--base64url"
                },
                {
                    "name": "--base32",
                    "content": "same as 'base32' program (RFC4648 section 6)\n",
                    "long": "--base32"
                },
                {
                    "name": "--base32hex",
                    "content": "extended hex alphabet base32 (RFC4648 section 7)\n",
                    "long": "--base32hex"
                },
                {
                    "name": "--base16",
                    "content": "hex encoding (RFC4648 section 8)\n",
                    "long": "--base16"
                },
                {
                    "name": "--base2msbf",
                    "content": "bit string with most significant bit (msb) first\n",
                    "long": "--base2msbf"
                },
                {
                    "name": "--base2lsbf",
                    "content": "bit string with least significant bit (lsb) first\n",
                    "long": "--base2lsbf"
                },
                {
                    "name": "-d --decode",
                    "content": "decode data\n",
                    "flag": "-d",
                    "long": "--decode"
                },
                {
                    "name": "-i --ignore-garbage",
                    "content": "when decoding, ignore non-alphabet characters\n",
                    "flag": "-i",
                    "long": "--ignore-garbage"
                },
                {
                    "name": "-w --wrap",
                    "content": "wrap encoded lines after COLS character (default 76).  Use 0 to disable line wrapping\n\n--z85  ascii85-like encoding (ZeroMQ spec:32/Z85); when encoding, input length must be a mul‐\ntiple of 4; when decoding, input length must be a multiple of 5\n\n--help display this help and exit\n",
                    "flag": "-w",
                    "long": "--wrap"
                },
                {
                    "name": "--version",
                    "content": "output version information and exit\n\nWhen decoding, the input may contain newlines in addition to the bytes of the  formal  alpha‐\nbet.  Use --ignore-garbage to attempt to recover from any other non-alphabet bytes in the en‐\ncoded stream.\n",
                    "long": "--version"
                }
            ]
        },
        "ENCODINGS EXAMPLES": {
            "content": "$ printf '\\376\\117\\202' | basenc --base64\n/k+C\n\n$ printf '\\376\\117\\202' | basenc --base64url\nk-C\n\n$ printf '\\376\\117\\202' | basenc --base32\n7ZHYE===\n\n$ printf '\\376\\117\\202' | basenc --base32hex\nVP7O4===\n\n$ printf '\\376\\117\\202' | basenc --base16\nFE4F82\n\n$ printf '\\376\\117\\202' | basenc --base2lsbf\n011111111111001001000001\n\n$ printf '\\376\\117\\202' | basenc --base2msbf\n111111100100111110000010\n\n$ printf '\\376\\117\\202\\000' | basenc --z85\n@.FaC\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Written by Simon Josefsson and Assaf Gordon.\n",
            "subsections": []
        },
        "REPORTING BUGS": {
            "content": "GNU coreutils online help: <https://www.gnu.org/software/coreutils/>\nReport any translation bugs to <https://translationproject.org/team/>\n",
            "subsections": []
        },
        "COPYRIGHT": {
            "content": "Copyright © 2020 Free Software Foundation, Inc.  License GPLv3+: GNU GPL version 3  or  later\n<https://gnu.org/licenses/gpl.html>.\nThis  is free software: you are free to change and redistribute it.  There is NO WARRANTY, to\nthe extent permitted by law.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "Full documentation <https://www.gnu.org/software/coreutils/basenc>\nor available locally via: info '(coreutils) basenc invocation'\n\n\n\nGNU coreutils 8.32                          January 2026                                   BASENC(1)",
            "subsections": []
        }
    },
    "summary": "basenc - Encode/decode data and print to standard output",
    "flags": [
        {
            "flag": "",
            "long": "--base64",
            "arg": null,
            "description": "same as 'base64' program (RFC4648 section 4)"
        },
        {
            "flag": "",
            "long": "--base64url",
            "arg": null,
            "description": "file- and url-safe base64 (RFC4648 section 5)"
        },
        {
            "flag": "",
            "long": "--base32",
            "arg": null,
            "description": "same as 'base32' program (RFC4648 section 6)"
        },
        {
            "flag": "",
            "long": "--base32hex",
            "arg": null,
            "description": "extended hex alphabet base32 (RFC4648 section 7)"
        },
        {
            "flag": "",
            "long": "--base16",
            "arg": null,
            "description": "hex encoding (RFC4648 section 8)"
        },
        {
            "flag": "",
            "long": "--base2msbf",
            "arg": null,
            "description": "bit string with most significant bit (msb) first"
        },
        {
            "flag": "",
            "long": "--base2lsbf",
            "arg": null,
            "description": "bit string with least significant bit (lsb) first"
        },
        {
            "flag": "-d",
            "long": "--decode",
            "arg": null,
            "description": "decode data"
        },
        {
            "flag": "-i",
            "long": "--ignore-garbage",
            "arg": null,
            "description": "when decoding, ignore non-alphabet characters"
        },
        {
            "flag": "-w",
            "long": "--wrap",
            "arg": null,
            "description": "wrap encoded lines after COLS character (default 76). Use 0 to disable line wrapping --z85 ascii85-like encoding (ZeroMQ spec:32/Z85); when encoding, input length must be a mul‐ tiple of 4; when decoding, input length must be a multiple of 5 --help display this help and exit"
        },
        {
            "flag": "",
            "long": "--version",
            "arg": null,
            "description": "output version information and exit When decoding, the input may contain newlines in addition to the bytes of the formal alpha‐ bet. Use --ignore-garbage to attempt to recover from any other non-alphabet bytes in the en‐ coded stream."
        }
    ],
    "examples": [],
    "see_also": [],
    "tldr": {
        "source": "official",
        "description": "Encode or decode file or `stdin` using a specified encoding, to `stdout`.",
        "examples": [
            {
                "description": "Encode a file with base64 encoding",
                "command": "basenc --base64 {{path/to/file}}"
            },
            {
                "description": "Decode a file with base64 encoding",
                "command": "basenc {{-d|--decode}} --base64 {{path/to/file}}"
            },
            {
                "description": "Encode from `stdin` with base32 encoding with 42 columns",
                "command": "{{command}} | basenc --base32 {{-w|--wrap}} 42"
            },
            {
                "description": "Encode from `stdin` with base32 encoding",
                "command": "{{command}} | basenc --base32"
            }
        ]
    }
}