Advertisements

headerup to 320x100 / 728x90

YAML to Base64

Normalise a YAML document and encode it as UTF-8 Base64 — ideal for Kubernetes Secrets

Input
Loading editor...
Output

Output will appear here...

Advertisements

content bottomup to 300x250

What is YAML to Base64

Last reviewed:

YAML is a human-friendly data serialization format that relies on indentation instead of braces, commonly used for configuration in Kubernetes, CI/CD, and modern tooling.

YAML to Base64 parses your YAML, re-emits it with a canonical two-space indent and long-line tolerance, and encodes the result as UTF-8 Base64 using the browser's btoa.

It's the fastest way to prepare YAML payloads for Kubernetes Secrets, Docker config blobs, and any system that accepts Base64-encoded config strings.

Why use it

  • Prepare values for Kubernetes Secret data fields.
  • Pack YAML configs into CI / CD environment variables.
  • Embed YAML inside JSON-based deployment manifests.
  • Produce fixed Base64 payloads for tests.
  • Round-trip configs through systems that strip newlines.

Features

  • Parses and normalises YAML
  • UTF-8 safe Base64 encoding
  • Kubernetes Secret-ready output
  • YAML to Base64 never leaves your machine
  • Stable, diff-friendly normalisation

How to use YAML to Base64

  1. Paste YAML. Drop your YAML document.
  2. Click Run. YAML is normalised and Base64-encoded.
  3. Copy result. Paste into your Kubernetes Secret or config.

Example (before/after)

YAML

name: Ada
role: admin

Base64

bmFtZTogQWRhCnJvbGU6IGFkbWluCg==

Common errors

Non-UTF-8 characters

btoa only handles Latin-1.

Fix: The tool first converts to UTF-8 via encodeURIComponent/unescape before Base64 encoding.

Mixed indentation

Irregular indentation can break YAML parsing.

Fix: Run the YAML formatter first.

FAQ

Is output standard Base64?

Yes — UTF-8 bytes are encoded using the standard Base64 alphabet.

Does it normalise the YAML?

Yes — the tool re-emits with two-space indent before encoding so diffs are stable.

Is it the same as Kubernetes Secret format?

Yes — you can paste the output directly into a `data:` block.

Does it support multi-doc YAML?

Single-document YAML only for now. Split multi-docs manually first.

Is input uploaded?

No — encoding runs in your browser.

Related tools

Pair YAML to Base64 with formatter, validator, and JSON converters. You can also browse the full Encoders & Decoders category for more options.