How to use the Kubernetes Secret decoder tool
- Export the Secret, for example with kubectl get secret db-credentials -o yaml.
- Paste the YAML or JSON manifest into the Secret JSON or YAML box.
- Select Decode Secret. Select Example to see a one-key sample decoded.
- Read the decoded keys and values in the Result box, shown as a JSON object.
- Select Copy if you need the output, then select Clear when you are done.
Why Kubernetes Secret values are Base64
The data field of a Secret is a map from key names to byte strings. YAML and JSON cannot hold raw bytes, so the API requires each value to be Base64 encoded with the standard alphabet from RFC 4648. That lets one field carry a password, a TLS private key or a binary keystore.
The encoding gives no protection. Anyone who can read the Secret object can decode it, and by default the API server stores Secrets unencrypted in etcd unless encryption at rest is configured. Access control comes from RBAC, not from Base64.
Worked example with text and binary values
The first two values are UTF-8 text and are shown as such. The third decodes to four bytes that are not valid UTF-8, so the tool reports the byte count in place of unreadable characters.
apiVersion: v1
kind: Secret
metadata:
name: db-credentials
type: Opaque
data:
username: YWRtaW4=
password: czNjcjN0LXBhc3M=
ca.bin: /+7/AA==
{
"username": "admin",
"password": "s3cr3t-pass",
"ca.bin": "Binary · 4 bytes"
}What the Kubernetes Secret decoder reads and ignores
The input is read with a YAML parser, which also accepts JSON, so output from -o yaml and -o json both work.
- kind must be Secret and the manifest must contain a data mapping.
- Every value under data must be a string. An unquoted number or an empty value is reported by key name.
- Values wrapped over several lines decode normally, since whitespace is stripped first.
- metadata, type and stringData are not shown. stringData is already plain text.
- Only one YAML document is accepted. Split files that contain --- separators.
- A kind: List from kubectl get secrets is not unpacked. Paste a single item.
Common decoding problems
If one value is not valid Base64, the whole run stops and no partial result is shown. Look for values that were typed as plain text into data when they belonged in stringData, or that were cut short when copied.
A value shown as Binary is not an error. Certificates in DER form, Java keystores and compressed files are binary by nature. PEM certificates and keys are text and decode to their familiar BEGIN and END lines. A .dockerconfigjson value decodes to JSON whose auth field is itself Base64 of user:password.
Frequently asked questions
Is the Secret sent to a server when I decode it?
No. The manifest is parsed and decoded by JavaScript in your browser, and the result never leaves the page. Treat the decoded output like any credential: avoid screen sharing and clear the form afterwards.
How do I decode a Kubernetes Secret with kubectl alone?
For a single key, run kubectl get secret NAME -o jsonpath='{.data.KEY}' and pipe the output into base64 -d. That suits one value. This tool is quicker when a Secret has many keys and you want all of them decoded together.
Why does a value show as Binary with a byte count?
The decoded bytes are not valid UTF-8, so printing them would produce unreadable characters. The tool shows the length instead. Paste that single value into the Base64 to Hex or Base64 to File tool on this site to inspect or download the bytes.
Does it decode stringData too?
There is nothing to decode. stringData holds plain text that the API server converts into data when the object is written, and it is not returned when you read the Secret back. The tool reads the data field only and requires it to be present.
Can I decode a ConfigMap or a SealedSecret here?
No. The tool checks that kind is Secret. ConfigMap values under data are already plain text, and a SealedSecret holds encrypted data that only the controller's private key in the cluster can open.