FormatterHQ

Base64 to YAML

Decode Base64 back into YAML with its indentation intact — handy for kubeconfigs in CI secrets, cloud-init user data and encoded config values.

Loading tool…
Ready.

How to use the Base64 to YAML

  1. Type or paste into the Base64 box, or click Sample. You can also drop a file on a box or use its Open file button.
  2. The YAML box updates live as you type. It works both ways — edit the YAML side to convert back, or click ⇄ Swap to exchange the sides.
  3. Alphabet and Wrap lines at 76 chars (MIME) in the options bar above the editors only affect the reverse direction — the Base64 output you get when you type in the YAML box.
  4. Use Copy or Download on either box to take the result, or Clear to start again.

Base64 to YAML decoder

Base64 to YAML decoding restores a configuration file that was packed into a single line. Paste the string from a CI variable, a cloud console or an API response, and the tool decodes it and shows the YAML with syntax highlighting so you can check keys, nesting and values.

Example

Base64 input:

YXBpVmVyc2lvbjogdjEKa2luZDogQ29uZmlnTWFwCmRhdGE6CiAgbW9kZTogcHJvZHVjdGlvbgogIHJlcGxpY2FzOiAiMyI=

Decoded YAML:

apiVersion: v1
kind: ConfigMap
data:
  mode: production
  replicas: "3"

Common sources

  • Kubeconfig files stored as Base64 secrets in GitHub Actions, GitLab CI or other pipelines.
  • EC2 and other cloud instance user data shown in Base64 in consoles and APIs.
  • Helm release data and Argo CD or Flux resources that embed configuration as encoded strings.
  • Individual values from Kubernetes Secrets — for example, a secret that holds an application config file.

Decoding Kubernetes Secret values

A Kubernetes Secret stores each value Base64 encoded. To read one on the command line: kubectl get secret my-secret -o jsonpath='{.data.config\.yaml}' | base64 -d. If you already have the string, paste it here instead. The tool decodes one value at a time; the Secret manifest around it is plain YAML.

Checking the result

  • Indentation is restored exactly as it was encoded, so if nesting looks wrong, the YAML was already broken before encoding.
  • Trailing newlines are kept; they are part of the encoded bytes. Windows (CRLF) line endings are shown as plain line feeds, because the editor stores every line break that way.
  • Binary output (a hex dump) means the value was not YAML — perhaps it was compressed, or it is a certificate in DER format.

To confirm the decoded document parses, run it through the YAML Validator or convert it with YAML to JSON. Encode it again with YAML to Base64.

Kubeconfigs often contain Base64 inside Base64: the certificate-authority-data, client-certificate-data and client-key-data fields are themselves Base64-encoded PEM files. Decode one of those values again to see the certificate in its -----BEGIN CERTIFICATE----- form.

When the decoded YAML still will not load

  • Tabs in the indentation. YAML does not allow tab characters for indentation. Base64 restores them faithfully, so a file that was written with tabs decodes fine but fails to parse. Replace them with spaces.
  • Encoded twice. If the output is another long string of letters and digits, the value was Base64-encoded two times, which is a common slip when a script encodes a value that was already encoded. Paste the output back in to decode it again.
  • data versus stringData. In a Kubernetes Secret, only values under data are Base64. Values under stringData are plain text and need no decoding.
  • A stray newline. echo 'key: value' | base64 encodes a trailing line break. That is harmless for a YAML file, but for single values such as passwords use printf '%s' when encoding.

Handle credentials with care

Decoded kubeconfigs and secrets often contain tokens, client keys or passwords. The decoding happens only in your browser and nothing is uploaded unless you click Save & Share, so do not create a share link for real secrets; copy the result straight to where it belongs and avoid leaving it in shared documents or chat.

Frequently asked questions

How do I decode a Kubernetes secret value?
Copy the Base64 value from the data section of the Secret and paste it here, or run kubectl get secret … -o jsonpath with base64 -d on the command line.
Why is my decoded YAML shown as a hex dump?
The decoded bytes are not valid UTF-8 text, so the value is binary — for example compressed data or a DER-encoded certificate.
Is the indentation preserved?
Yes. Spaces, tabs and line breaks come back as they were encoded; only Windows CRLF line endings are shown as plain line feeds.
Does the tool validate the YAML?
It decodes and highlights the YAML but does not validate it. Use a YAML validator to check the structure.

Last updated October 3, 2026

Related tools