base64 transforms data read from a file, or standard input, into (or from) base64 encoded form. The base64 encoded form uses printable ASCII characters to represent binary data. Synopses:
base64 [OPTION]... [FILE]
base64 --decode [OPTION]... [FILE]
The base64 encoding expands data to roughly 133% of the original. The base32 encoding expands data to roughly 160% of the original. The format conforms to RFC 4648 (https://tools.ietf.org/search/rfc4648).
| Use Case | Command | Description |
|---|---|---|
| 📄 Encode a file | base64 FILE | Encode FILE to base64, output to stdout |
| 🔓 Decode a file | base64 --decode FILE | Decode base64-encoded FILE to original data |
| 📏 Encode with custom wrap width | base64 -w 0 FILE | Encode without line wrapping (single line) |
| 🗑️ Decode ignoring garbage | base64 --decode --ignore-garbage FILE | Decode, ignoring unrecognized bytes |
base64 [OPTION]... [FILE]
base64 --decode [OPTION]... [FILE]
The program accepts the following options. Also see Common options.
-w COLS / --wrap=COLS — During encoding, wrap lines after COLS characters. This must be a positive number. The default is to wrap after 76 characters. Use the value 0 to disable line wrapping altogether.-d / --decode — Change the mode of operation, from the default of encoding data, to decoding data. Input is expected to be base64 encoded data, and the output will be the original data.-i / --ignore-garbage — When decoding, newlines are always accepted. During decoding, ignore unrecognized bytes, to permit distorted data to be decoded.An exit status of zero indicates success, and a nonzero value indicates failure.
Generated by phpman v4.10.0-7-g98e9fd5 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-09-17 03:15 @216.73.217.113
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)