YAML to Base64

Validate YAML, then encode it as UTF-8 Base64.

Local Your input is processed locally in your browser. The first run loads the open-source js-yaml library from this site; your input is not sent anywhere. Found a problem? Report an issue

What YAML to Base64 does

Validate YAML, then encode it as UTF-8 Base64. Text is handled as UTF-8, so accented letters, other scripts and emoji survive the round trip.

YAML to Base64 examples

The built-in sample

Input

name: Ada
tags:
  - math
  - code
address:
  city: London

Output

bmFtZTogQWRhCnRhZ3M6CiAgLSBtYXRoCiAgLSBjb2RlCmFkZHJlc3M6CiAgY2l0eTogTG9uZG9u

This is the input that the Load sample button fills in.

A trailing line break is kept

Input

a: 1

Output

YTogMQo=

The final line break is part of the encoded bytes (the Cg== at the end).

Each output was produced by running this tool on the input above it.

How it works

The input is first checked as YAML; invalid input is reported instead of being encoded. The text is then converted to UTF-8 bytes and encoded with the standard Base64 alphabet (RFC 4648), padded with = to a multiple of four characters.

Details and limits

  • Encoding and decoding are exact, so the data comes back without losing anything.
  • A typical use is a configuration file stored as a value under data: in a Kubernetes Secret, where each value is the Base64 of the raw text.
  • The YAML is checked first, so a broken document is not encoded by accident.
  • Input that is not valid YAML stops the tool, and the status line shows where the problem is. The YAML Validator page lists the usual causes.

Questions

Is my data uploaded when I use YAML to Base64?

No. The tool runs in your browser, so what you paste or open is processed on your own device and is not sent to a server.

What does YAML to Base64 do?

Validate YAML, then encode it as UTF-8 Base64. Text is handled as UTF-8, so accented letters, other scripts and emoji survive the round trip.

How does YAML to Base64 work?

The input is first checked as YAML; invalid input is reported instead of being encoded. The text is then converted to UTF-8 bytes and encoded with the standard Base64 alphabet (RFC 4648), padded with = to a multiple of four characters.

Are there any limits I should know about?

A typical use is a configuration file stored as a value under data: in a Kubernetes Secret, where each value is the Base64 of the raw text. The YAML is checked first, so a broken document is not encoded by accident.

Is there a size limit?

There is no fixed size limit. Everything happens on your device, so very large inputs depend on its memory and can take longer on a phone than on a computer.

Does it work on phones, and is it free?

Yes. It works in any current browser on Android phones, iPhones, tablets and computers. It is free and needs no account or sign-up.