Kubernetes Secret stringData vs data — which Base64 do I use?
data: requires Base64-encoded values — use this tool to produce them. stringData: takes raw plaintext and Kubernetes Base64-encodes it on apply, then merges into data:. Both end up as Base64 in the stored Secret. Use stringData for hand-edited manifests (less error-prone) and data for tools or pipelines that already produce Base64.
How do I add this Base64 to my Secret manifest?
Encode the value here, then paste under data: as: <key>: <base64-string>. Example: data:\n config.yaml: YXBpVmVyc2lvbjogdjEK...\nWhen kubectl applies the manifest, it stores the value verbatim. Reading it back via kubectl get secret -o yaml shows the same Base64.
Can I encode the entire Secret manifest, or just a single value?
Both. Encode a single YAML config (database connection settings, app config) to drop into one data: key. Or encode an entire YAML document to store the whole config as a single Secret value — common when an app reads a config.yaml file from a mounted Secret. Either case is one paste-and-encode round.
My password contains special characters — will it survive Base64?
Yes. The encoder runs through UTF-8 (btoa(unescape(encodeURIComponent(s)))) so any character — including symbols, quotes, dollar signs, and multi-byte glyphs — is preserved exactly through the round-trip. The decoded YAML is byte-identical to what you pasted.
Should I use standard Base64 or URL-safe Base64url for K8s Secrets?
Standard Base64 only. The Kubernetes Secret data validator requires the standard alphabet (+, /, = padding) per the API schema. URL-safe Base64url is for URL parameters and JWT-style tokens — Kubernetes will reject it.
Should I include a trailing newline in the YAML?
Most YAML tools tolerate either. The encoder trims trailing whitespace before encoding, so the Base64 you produce decodes back to exactly what you pasted minus surrounding blanks. If your app reads a file from a mounted Secret and expects a trailing newline, append one in the input box before encoding.
Is this the same as kubectl create secret generic --from-file?
Functionally yes — kubectl create secret reads the file, Base64-encodes it, and creates the Secret. This tool produces identical Base64 from pasted YAML so you can paste into a manifest you commit to Git (with appropriate encryption at rest) without shelling out to kubectl. For sealed-secret workflows, follow this with kubeseal on the resulting manifest.
Is my YAML uploaded to your servers?
No. UTF-8 encoding and Base64 conversion run inside your browser via btoa. Database passwords, API tokens, and TLS keys you encode never leave the page — verify in DevTools Network tab.