YAML URL Encode

Validate YAML, then percent-encode it for a URL, keeping its line breaks.

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 URL Encode does

Validate YAML, then percent-encode it for a URL, keeping its line breaks.

YAML URL Encode examples

The built-in sample

Input

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

Output

name%3A%20Ada%0Atags%3A%0A%20%20-%20math%0A%20%20-%20code%0Aaddress%3A%0A%20%20city%3A%20London

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

Line breaks and indentation survive

Input

a: 1
b:
  - x

Output

a%3A%201%0Ab%3A%0A%20%20-%20x

Each line break becomes %0A and each indentation space %20, so the structure of the YAML is intact after decoding.

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 percent-encoded with the same rules as URL Encode: everything except letters, digits and - _ . ! ~ * ' ( ) becomes %XX.

Details and limits

  • YAML depends on line breaks and indentation, so nothing is minified. That makes encoded YAML longer than the same data as encoded JSON.
  • Comments in the YAML are encoded along with everything else.
  • 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 URL Encode?

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 URL Encode do?

Validate YAML, then percent-encode it for a URL, keeping its line breaks.

How does YAML URL Encode work?

The input is first checked as YAML; invalid input is reported instead of being encoded. The text is percent-encoded with the same rules as URL Encode: everything except letters, digits and - _.! ~ * ' () becomes %XX.

Are there any limits I should know about?

YAML depends on line breaks and indentation, so nothing is minified. That makes encoded YAML longer than the same data as encoded JSON. Comments in the YAML are encoded along with everything else.

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.