YAML to Base64

Encode YAML to Base64 and decode it back — the same encoding Kubernetes Secrets use. See also storing data as Base64.

0 characters

Example

The YAML name: Ada encodes to bmFtZTogQWRh. In code you would do:

JavaScript
const yaml = "name: Ada";
const b64 = btoa(unescape(encodeURIComponent(yaml))); // "bmFtZTogQWRh"
const back = decodeURIComponent(escape(atob(b64)));

YAML to Base64 — FAQ

How do I Base64 encode YAML?+

Paste your YAML above and switch to Encode. This is exactly how Kubernetes Secrets and many CI/CD config systems store multi-line YAML or config values.

Why is YAML often Base64 encoded?+

YAML is whitespace-sensitive, so embedding it inside JSON, environment variables or Kubernetes Secret manifests as-is is error-prone. Base64 turns it into a single safe text blob.

Does Base64 preserve YAML indentation?+

Yes. Decoding returns the exact original bytes, including every space and newline, so indentation-sensitive YAML round-trips correctly.

Is this how Kubernetes Secrets work?+

Yes — Kubernetes Secret data fields store Base64-encoded values. Note this is encoding, not encryption, so Secrets still need RBAC and encryption-at-rest for real protection.