About the YAML to Base64 Converter
Putting a config into a Kubernetes secret, a CI variable or an environment value means encoding it first, and the encoding step is exactly where a mistake becomes invisible. A stray tab or a misaligned list item turns into an opaque string that only fails much later, in a cluster, with a message that points nowhere useful.
This encoder refuses to hide that from you. The YAML is parsed before anything is encoded, and if it does not parse you get the line number and the parser message instead of a payload. Only valid config gets through, which turns a deployment failure into a five second fix at your desk.
The JSON mode is there because plenty of receivers accept YAML in a file but want JSON in a field. Since every YAML document has a JSON equivalent, the tool converts and then encodes, with an option to compact the JSON first and save the bytes that indentation would waste. In this mode anchors and aliases are resolved and comments are dropped, which is what the receiving parser would do anyway.
The URL-safe alphabet suits values headed for a token or a query parameter, and the wrap widths match the block layout that manifests and mail bodies use. The status line names the document count so a multi document payload is never a surprise. Decode again with Base64 to YAML, or check the source first with YAML Validator.
How to use
- Paste your YAML into the left pane.
- Fix any parse error the tool reports before encoding.
- Switch Encode as to JSON when the receiver wants JSON in the field.
- Copy the Base64 into your secret, variable or manifest.
Common questions
- Why does it refuse to encode invalid YAML?
- Because the encoded form hides the mistake. Catching it here saves a failed deploy and a confusing log message.
- Does encoding count as protecting a secret?
- No. Base64 is not encryption and anyone can decode it. Use a real secret manager for anything sensitive.
- What happens to comments in JSON mode?
- They are dropped, because JSON has no comment syntax. Stay in YAML mode to keep them.
- Are multi document files supported?
- Yes. All documents are parsed, and the status line tells you how many were found.