CalcCafe

YAML to Base64

Base64-encode YAML text safely, including Unicode characters and emoji, right in your browser.

Example

Input YAML:

name: café
tags:
 - dev

Base64 output:

bmFtZTogY2Fmw6kKdGFnczoKICAtIGRldg==

How it works

Paste YAML in the input and the tool UTF-8 encodes it and emits Base64 instantly. Toggle MIME line-wrapping (76 chars) if you need email-friendly output.

Good to know

This YAML to Base64 tool converts YAML configuration text (or really any plain text) into a Base64 string directly in your browser. It's aimed at developers and DevOps engineers who need to embed a config file inside another format that only accepts a single line of safe ASCII characters — for example a Kubernetes Secret, a CI/CD pipeline variable, a JSON payload, or a data URI. Because it encodes to UTF-8 bytes first, accented letters, emoji, and other non-ASCII content in your YAML are preserved exactly.

Reach for it whenever something downstream can't safely carry raw YAML. Common cases include stuffing a multi-line config into a single environment variable, transmitting YAML through a system that mangles newlines or quotes, or storing structured settings in a field that expects an opaque token. The live output updates as you type, and the "Load sample" button gives you a quick reference for the expected format.

To read the result, remember that Base64 is encoding, not encryption: anyone can decode it back to the original YAML, so the output is fully reversible and offers no secrecy on its own. The character count in the status line confirms how many input characters mapped to how many Base64 characters; expect the output to be roughly one-third larger than the input, and to end in one or two = padding characters depending on the byte length.

A few practical pointers:

Frequently asked questions

Does this handle Unicode characters and emoji in my YAML?
Yes. The text is first encoded to UTF-8 bytes before Base64 encoding, so accented letters, emoji, and any non-ASCII content survive the round trip correctly (unlike a raw btoa call, which throws on such characters).
What does the 'Wrap lines at 76 chars' option do?
It splits the Base64 output into 76-character lines, matching the MIME standard used in email (RFC 2045). Leave it off for a single continuous string suitable for embedding in URLs, JSON, or config files.
Is my data uploaded anywhere?
No — this tool runs entirely in your browser. Your input never leaves your device and it works offline once loaded.
Is it free?
Yes, completely free with no sign-up and no limits.

People also ask

What is Base64 encoding used for with YAML files?
Base64 turns YAML text into a compact ASCII string that can travel safely through systems that don't tolerate newlines, indentation, or special characters — such as URL parameters, JSON fields, environment variables, and Kubernetes Secrets, which store all values as Base64.
How do I decode a Base64 string back to YAML?
Run the Base64 through any Base64 decoder, including command-line tools like 'base64 --decode' or 'echo <string> | base64 -d'. The output is the original UTF-8 YAML text, byte-for-byte.
Is Base64 encoding the same as encrypting my YAML?
No. Base64 is a reversible encoding with no key and no secret, so anyone can decode it instantly. It protects against character-set issues, not against someone reading your data.
Why is my Base64 output longer than the original YAML?
Base64 represents every 3 bytes of input as 4 ASCII characters, so the encoded string is about 33% larger than the source text, plus any padding characters at the end.
Do Kubernetes Secrets store YAML as Base64?
The values inside a Secret's 'data' field are Base64-encoded. Encoding your YAML or config value here produces a string you can paste into that field; Kubernetes decodes it back to the raw bytes when the Secret is mounted or read.
What do the equals signs at the end of a Base64 string mean?
They are padding characters that signal the input's byte length wasn't an exact multiple of three. You may see zero, one, or two '=' characters, and they're a normal, expected part of the encoding.
Can I Base64-encode YAML that contains emoji or accented characters?
Yes. The tool converts the text to UTF-8 bytes before encoding, so emoji, accents, and other non-ASCII characters round-trip correctly — unlike a plain browser btoa() call, which fails on such characters.
Should I wrap Base64 output at 76 characters?
Only for MIME/email contexts (RFC 2045) that expect line-wrapped Base64. For URLs, JSON, config files, and most programmatic uses, keep it as one unbroken line.

Related tools