{
    "content": [
        {
            "type": "text",
            "text": "# basenc (man)\n\n## NAME\n\nbasenc - Encode/decode data and print to standard output\n\n## SYNOPSIS\n\nbasenc [OPTION]... [FILE]\n\n## DESCRIPTION\n\nbasenc encode or decode FILE, or standard input, to standard output.\n\n## TLDR\n\n> Encode or decode file or `stdin` using a specified encoding, to `stdout`.\n\n- Encode a file with base64 encoding:\n  `basenc --base64 {{path/to/file}}`\n- Decode a file with base64 encoding:\n  `basenc {{-d|--decode}} --base64 {{path/to/file}}`\n- Encode from `stdin` with base32 encoding with 42 columns:\n  `{{command}} | basenc --base32 {{-w|--wrap}} 42`\n- Encode from `stdin` with base32 encoding:\n  `{{command}} | basenc --base32`\n\n*Source: tldr-pages*\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION** (11 subsections)\n- **ENCODINGS EXAMPLES**\n- **AUTHOR**\n- **REPORTING BUGS**\n- **COPYRIGHT**\n- **SEE ALSO**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "basenc",
        "section": "",
        "mode": "man",
        "summary": "basenc - Encode/decode data and print to standard output",
        "synopsis": "basenc [OPTION]... [FILE]",
        "tldr_summary": "Encode or decode file or `stdin` using a specified encoding, to `stdout`.",
        "tldr_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"
            }
        ],
        "tldr_source": "official",
        "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": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 6,
                "subsections": [
                    {
                        "name": "--base64",
                        "lines": 2,
                        "long": "--base64"
                    },
                    {
                        "name": "--base64url",
                        "lines": 2,
                        "long": "--base64url"
                    },
                    {
                        "name": "--base32",
                        "lines": 2,
                        "long": "--base32"
                    },
                    {
                        "name": "--base32hex",
                        "lines": 2,
                        "long": "--base32hex"
                    },
                    {
                        "name": "--base16",
                        "lines": 2,
                        "long": "--base16"
                    },
                    {
                        "name": "--base2msbf",
                        "lines": 2,
                        "long": "--base2msbf"
                    },
                    {
                        "name": "--base2lsbf",
                        "lines": 2,
                        "long": "--base2lsbf"
                    },
                    {
                        "name": "-d --decode",
                        "lines": 2,
                        "flag": "-d",
                        "long": "--decode"
                    },
                    {
                        "name": "-i --ignore-garbage",
                        "lines": 2,
                        "flag": "-i",
                        "long": "--ignore-garbage"
                    },
                    {
                        "name": "-w --wrap",
                        "lines": 7,
                        "flag": "-w",
                        "long": "--wrap"
                    },
                    {
                        "name": "--version",
                        "lines": 6,
                        "long": "--version"
                    }
                ]
            },
            {
                "name": "ENCODINGS EXAMPLES",
                "lines": 24,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "REPORTING BUGS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "COPYRIGHT",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 6,
                "subsections": []
            }
        ],
        "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": []
            }
        }
    }
}