| BASE64(1) | General Commands Manual | BASE64(1) |
NAME¶
base64 - encode/decode data and print to standard output With no FILE, or when FILE is -, read standard input.
The data are encoded as described for the base64 alphabet in RFC 3548. When decoding, the input may contain newlines in addition to the bytes of the formal base64 alphabet. Use --ignore-garbage to attempt to recover from any other non-alphabet bytes in the encoded stream.
SYNOPSIS¶
base64 [-d|--decode] [-i|--ignore-garbage] [-w|--wrap] [-h|--help] [-V|--version] [file]
DESCRIPTION¶
encode/decode data and print to standard output With no FILE, or when FILE is -, read standard input.
The data are encoded as described for the base64 alphabet in RFC 3548. When decoding, the input may contain newlines in addition to the bytes of the formal base64 alphabet. Use --ignore-garbage to attempt to recover from any other non-alphabet bytes in the encoded stream.
OPTIONS¶
- -d, --decode
- decode data
- -i, --ignore-garbage
- when decoding, ignore non-alphabetic characters
- -w, --wrap <COLS>
- wrap encoded lines after COLS character (default 76, 0 to disable wrapping)
- -h, --help
- Print help
- -V, --version
- Print version
- [file]
VERSION¶
v(uutils coreutils) 0.8.0
EXAMPLES¶
Encode a file:
base64 path/to/file
Wrap encoded output at a specific width (`0` disables wrapping):
base64 [-w|--wrap] 0|76|... path/to/file
Decode a file:
base64 [-d|--decode] path/to/file
Encode from `stdin`:
command | base64
Decode from `stdin`:
command | base64 [-d|--decode]
The examples are provided by the tldr-pages project <https://tldr.sh> under the CC BY 4.0 License. Please note that, as uutils is a work in progress, some examples might fail.
| 2026-05-17 |