base32
Encode or decode base32 data
TLDR
Encode a file
Wrap encoded output at a specific width (0 disables wrapping)
Decode a file
Encode from stdin
Decode from stdin
SYNOPSIS
base32 [OPTION]... [FILE]
FILE can be omitted or specified as '-' to read from standard input.
PARAMETERS
-d, --decode
Decode data rather than encode.
-i, --ignore-garbage
When decoding, ignore non-Base32 alphabet characters from the input.
-w, --wrap=COLS
Wrap encoded output lines after COLS characters. Use 0 to disable wrapping.
--help
Display a help message and exit.
--version
Output version information and exit.
DESCRIPTION
The base32 command is a utility for encoding and decoding data using the Base32 algorithm, as specified in RFC 4648. It reads binary or textual input from standard input or a specified FILE, processes it, and writes the resulting Base32 encoded or decoded data to standard output.
While similar in purpose to base64, Base32 uses a 32-character alphabet (typically A-Z and 2-7), resulting in a more verbose output (5 bits per character) compared to Base64 (6 bits per character). This verbosity can sometimes be advantageous for human readability, ease of transcription, or compatibility with systems that have case-insensitivity or restrictive character sets. It is particularly useful for transmitting binary data over channels that may not handle raw binary safely, or when a less ambiguous encoding than Base64 is desired.
CAVEATS
Base32 encoding is less space-efficient than Base64 encoding, as it represents 5 bits of data per character compared to Base64's 6 bits.
Default output wrapping (76 characters) might need to be explicitly disabled (-w 0) when piping output to other commands or storing binary data where line breaks are undesirable.
<I>RFC 4648</I> COMPLIANCE
The command strictly follows the Base32 encoding scheme defined in RFC 4648, using an alphabet of uppercase letters (A-Z) and digits (2-7), excluding '0', '1', '8', '9' to avoid common ambiguities.
INPUT/OUTPUT BEHAVIOR
By default, base32 reads from standard input and writes to standard output. This makes it highly versatile for use in shell pipelines to process data from various sources and direct output to files or other commands.
HISTORY
The base32 command is part of the GNU Coreutils package, which provides fundamental utilities for the GNU operating system. Its implementation adheres to the Base32 encoding specification outlined in RFC 4648, "The Base16, Base32, and Base64 Data Encodings", published in 2006. While Base64 gained widespread adoption earlier, Base32 found its niche in specific applications requiring a more restricted character set or improved human readability, such as DNSSEC records or certain software distribution checksums.