Base64 to YAML Converter
Decode Base64-encoded strings to YAML format instantly. Paste or upload Base64 input and get clean, syntax-highlighted YAML output with download option.
About
Base64 encoding transforms binary or text data into a 64-character ASCII subset for safe transport over channels that corrupt raw bytes - email (MIME), JSON payloads, CI/CD environment variables. When YAML configuration files are embedded this way, a single misplaced character during manual decoding corrupts the entire document. Broken indentation in YAML is not cosmetic. It changes key hierarchy, merges mapping values, and silently alters application behavior. This tool decodes Base64 input using the standard alphabet (A - Z, a - z, 0 - 9, +, /) with = padding, then renders the resulting YAML with syntax highlighting for immediate structural verification.
The converter handles full UTF-8 multi-byte sequences - meaning non-ASCII characters in YAML comments or string values survive the round-trip. Note: this tool decodes the Base64 transport layer. It does not parse or validate YAML semantics. If your source encoded a malformed YAML document, the output will faithfully reproduce that malformation. Pro tip: Kubernetes Secrets store values as Base64. Decoding them with generic tools that strip trailing newlines can break multi-line YAML blocks. This converter preserves whitespace exactly as encoded.
Formulas
Base64 encoding maps every group of 3 input bytes (24 bits) to 4 printable ASCII characters (6 bits each). The output size relationship is:
Where nin = number of input bytes and nout = number of Base64 characters (including = padding). During decoding (this tool's operation), the inverse applies:
Where p = number of padding = characters (0, 1, or 2). Each Base64 character is resolved to its 6-bit index via the alphabet lookup. The concatenated bit stream is then split into 8-bit bytes and interpreted as UTF-8 code points to produce the final YAML text.
For UTF-8 multi-byte recovery, each byte b is checked: if b < 0x80, it is ASCII. If b matches the pattern 110xxxxx, a 2-byte sequence follows. Patterns 1110xxxx and 11110xxx indicate 3-byte and 4-byte sequences respectively.
Reference Data
| Base64 Character | Decimal Value | Binary (6-bit) | Notes |
|---|---|---|---|
| A | 0 | 000000 | Index start |
| Z | 25 | 011001 | Uppercase end |
| a | 26 | 011010 | Lowercase start |
| z | 51 | 110011 | Lowercase end |
| 0 | 52 | 110100 | Digit start |
| 9 | 61 | 111101 | Digit end |
| + | 62 | 111110 | Standard alphabet |
| / | 63 | 111111 | Standard alphabet |
| = | - | - | Padding character |
| Common YAML Tokens | |||
| : (colon+space) | - | - | Key-value separator |
| - (dash+space) | - | - | List item indicator |
| # | - | - | Comment prefix |
| | | - | - | Literal block scalar |
| > | - | - | Folded block scalar |
| & / * | - | - | Anchor / Alias |
| --- | - | - | Document start marker |
| ... | - | - | Document end marker |
| Encoding Ratios | |||
| Input size | Base64 output size | Ratio | |
| 3 bytes | 4 chars | 1.33× expansion | |
| 1 KB | 1.37 KB | ~37% overhead | |
| 1 MB | 1.37 MB | ~37% overhead | |
Frequently Asked Questions
base64 -d.