BASENC(1)

πŸ“¦
version 9.10 Β· 5 versions
, in ubuntu stonking

🌸 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 the base64 program (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 the base32 program (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). Use 0 to disable line wrapping. (yes, default is 76, and yes 0 means no wrapping at all.)
  • --z85 β€” ascii85-like encoding (ZeroMQ spec:32/Z85); when encoding, input length must be a multiple of 4; when decoding, input length must be a multiple of 5. 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:


πŸ’œ SEE ALSO πŸ’œ

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