BASENC(1)
πΈ BASENC(1) β the girlies' guide to basenc πΈ
okay so bestie, this is basenc, a User Commands page from GNU coreutils, and it's literally the swiss army knife of encoding. sit down, hydrate, and let's get into it π«Ά
β¨ NAME β¨
basenc β encode/decode data and print to standard output
β¨ SYNOPSIS β¨
basenc [OPTION]... [FILE]
π DESCRIPTION π
basenc encodes or decodes FILE, or standard input, straight to standard output. that's the whole vibe, no cap.
With no FILE, or when FILE is -, it reads from standard input. classic.
Mandatory arguments to long options are mandatory for short options too β yes that's a real sentence and yes it means what it means, keep up π
--base64β same as thebase64program (RFC4648 section 4). the og, the icon, the moment.--base64urlβ file- and url-safe base64 (RFC4648 section 5). for when your base64 is going somewhere URLs live and+and/are simply not invited.--base58β visually unambiguous base58 encoding. no confusing lookalike characters, it's giving "I read carefully and I cannot be tricked" π--base32β same as thebase32program (RFC4648 section 6).--base32hexβ extended hex alphabet base32 (RFC4648 section 7). base32's cooler cousin.--base16β hex encoding (RFC4648 section 8). good old hex fr fr.--base2msbfβ bit string with most significant bit (msb) first.--base2lsbfβ bit string with least significant bit (lsb) first. the two of these are besties who refuse to agree on bit order π-d,--decodeβ decode data. go backwards, be a reverse main character.-i,--ignore-garbageβ when decoding, ignore non-alphabet characters. the "I do not see it" option π-w,--wrap=COLSβ wrap encoded lines after COLS character (default 76). Use0to disable line wrapping. (yes, default is76, and yes0means no wrapping at all.)--z85β ascii85-like encoding (ZeroMQ spec:32/Z85); when encoding, input length must be a multiple of4; when decoding, input length must be a multiple of5. it's picky and it knows it. respect the multiples or it will simply not.--helpβ display this help and exit. we love a helper.--versionβ output version information and exit.
π¨ important caveat bestie: when decoding, the input may contain newlines in addition to the bytes of the formal alphabet. Use --ignore-garbage to attempt to recover from any other non-alphabet bytes in the encoded stream.
so newlines? fine, invited, always welcome. literally anything else? that's garbage and it needs -i to be survived. don't say I didn't warn you β¨
π ENCODING EXAMPLES π
these are the examples, copied exactly, because the facts do not change even when the vibe does:
$ printf '\376\117\202' | basenc --base64
/k+C
$ printf '\376\117\202' | basenc --base64url
_k-C
$ printf '\376\117\202' | basenc --base32
7ZHYE===
$ printf '\376\117\202' | basenc --base32hex
VP7O4===
$ printf '\376\117\202' | basenc --base16
FE4F82
$ printf '\376\117\202' | basenc --base2lsbf
011111111111001001000001
$ printf '\376\117\202' | basenc --base2msbf
111111100100111110000010
$ printf '\376\117\202\000' | basenc --z85
@.FaC
look at that. same three bytes, eight different outfits, every single one of them ate π₯
π¦ AUTHOR π¦
Written by Simon Josefsson and Assaf Gordon. legends, honestly. ty for your service π«Ά
π REPORTING BUGS π
found a bug? do NOT suffer in silence, tell the devs:
- Report bugs to:
bug-coreutils@gnu.org - GNU coreutils home page: <https://www.gnu.org/software/coreutils/>
- General help using GNU software: <https://www.gnu.org/gethelp/>
- Report any translation bugs to <https://translationproject.org/team/>
π SEE ALSO π
- Full documentation <https://www.gnu.org/software/coreutils/basenc>
- or available locally via:
info '(coreutils) basenc invocation'
Packaged by Ubuntu (9.10-1ubuntu2).
π so that's the whole thing. you now know every option, every RFC section, every default, and the fact that --z85 will absolutely hold you to your multiples. periodt. π
and now the cute sign-off: this darling lives under GNU coreutils 9.10, dated August 2026, and it ships with Copyright Β© 2026 Free Software Foundation, Inc. β License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. mwah πβ¨
π¦ where this page comes from
- ubuntu stonking: gnu-coreutils 9.10-1ubuntu2 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms