Base64-encode YAML

Convert any YAML text to Base64 with the Base64-encode YAML tool. Clean up whitespace, add a data URI prefix, and export your encoded result instantly.

Paste your input above or import a file below.
No file chosen
Supported file types: .yaml, .yml, .txt, .json, .xml, .md, .ini
Total characters: 0
Options
Strip extra whitespace
Add "data:text/plain;base64," prefix
Maximize output

How to Use:

  • Paste your YAML into the Input Text area or import a .yaml, .yml, or compatible file using the Choose File button.
  • Toggle Strip extra whitespace if you want to collapse and trim spaces before encoding.
  • Toggle Add “data:text/plain;base64,” prefix to output a complete data URI string instead of just raw Base64.
  • Toggle Maximize output to expand the result area for easier viewing and copying.
  • Click Encode to convert the YAML to Base64 with your selected options.
  • Use Copy Output to copy the encoded result.
  • Click Export to File to download the Base64 as a .txt file.
  • Use Clear All to reset everything including counters, toggles, and the input.

What Base64-encode YAML can do:

This tool turns your YAML content into Base64 on the fly. It’s useful when you need to embed YAML in URLs, transfer config as a string, or generate data URIs. You can optionally collapse all spacing first, which is useful if your YAML has large indents or blank lines. It also includes a toggle to prepend the data:text/plain;base64, prefix if you’re preparing inline resources. The tool updates live, so every keystroke instantly regenerates the output. It also includes a live character counter, output preview, file support, and easy export and copy buttons to speed things up.

Example:

Before:
name: Alice
admin: true

After:
bmFtZTogQWxpY2UKYWRtaW46IHRydWUK

Common Use Cases:

Great for embedding YAML in web apps, APIs, GitHub Actions secrets, or any scenario where configs need to be passed as a Base64 string. It’s also helpful when packaging YAML into inline blobs or sending through systems that expect encoded input.

Useful Tools & Suggestions:

If you’re encoding YAML to Base64, you’ll probably want Base64-decode YAML handy for when you need to bring it back to readable form. And before encoding, it’s a good idea to Minify YAML to shrink things down and avoid wasting space.