JSON Converters Code Gen Formatters All tools Browse all tools built byAbhay Darji

YAML to Base64 Encoder

Encode YAML as Base64. Unicode-safe, with URL-safe output available.

100% client side No upload No size limit Works offline
Input
Output
Ready
Drop a file to load it

About this tool

Encode a YAML document as Base64 — for embedding in a data URI, a JWT payload, or any transport that only guarantees ASCII.

When you would use it

  • Embedding YAML in a data URI
  • Putting a payload in a header or environment variable
  • Transporting data through an ASCII-only channel

Worked example

YAML
id: 4815
name: Ada Lovelace
active: true
score: 91.5
roles:
  - admin
  - editor
address:
  city: London
  postcode: NW1
Base64
aWQ6IDQ4MTUKbmFtZTogQWRhIExvdmVsYWNlCmFjdGl2ZTogdHJ1ZQpzY29yZTogOTEuNQpyb2xlczoKICAtIGFkbWluCiAgLSBlZGl0b3IKYWRkcmVzczoKICBjaXR5OiBMb25kb24KICBwb3N0Y29kZTogTlcx

Things worth knowing

  • Encoding goes through UTF-8 bytes, so non-Latin text and emoji are handled correctly — unlike btoa, which throws on them.
  • A URL-safe mode swaps + and / for - and _ and drops padding, for use in URLs and filenames.
  • Base64 is an encoding, not encryption. Anyone can decode it.
Questions

Frequently asked

Why not just use btoa()?
btoa only handles Latin-1 and throws on any character above U+00FF, which includes most non-English text and every emoji. This encoder converts to UTF-8 bytes first, so it works on any input.
Is Base64 secure?
No. It is an encoding, trivially reversible by anyone. Never use it to protect secrets.
Is my data uploaded anywhere?
No. Every tool on JSONWorks runs entirely in your browser using JavaScript. Your input is never sent to a server, never logged and never stored. The simplest proof is to disconnect from the internet — the tools keep working. The site does load Google Fonts and a Google Analytics page-view tag, so you will see those two requests in your network tab, but neither receives anything you type or paste.
Related

Tools that pair well with this