Convert

Result

Reads a YAML map or list and writes JSON indented by two spaces. A bare string, a number, or an empty document is refused.

About this tool

YAML maps and lists line up with JSON objects and arrays. This page reads a YAML document that already has that shape and prints the JSON, so a config file can be checked where JSON is required.

name: Ada and city: Ankara become {"name":"Ada","city":"Ankara"}. A list of those maps becomes a JSON array. Indentation in the YAML is what groups the fields.

A document that is only a string, a number, or empty does not convert, because the parser requires an object. Custom tags are not part of the JSON schema it accepts. Give it a map or a list and paste again.

How to use it

  1. 1

    Paste YAML or drop a file. The sample button inserts a short example. The value must be a map or a list.

  2. 2

    Only the JSON schema of YAML is read. Custom tags and exotic types are not accepted.

  3. 3

    The result is JSON with a two-space indent. A bare string, number, or empty document is rejected because the parser requires an object.

What it accepts

A map such as name: Ada and city: Ankara becomes {"name":"Ada","city":"Ankara"} with a two-space indent. A YAML list becomes a JSON array. A bare string, a number, or an empty document is rejected because the parser requires an object. An array is accepted. Custom tags and exotic types sit outside the JSON schema and are not accepted.

Where your data stays

The YAML document and the JSON written from it never leave this browser. MegaToolkit is not given a copy. A file above 2 MB is not opened. Copy the JSON or use the page download for the converted text. Closing the tab clears both.

Questions

Why was a plain string rejected?

The parser requires an object. A bare string, a number, or an empty document has no object root, so it is refused. A YAML array is accepted.

Are custom tags kept?

No. Only the JSON schema of YAML is read. Custom tags and exotic types are not accepted.

How is the JSON formatted?

It is indented by two spaces. A map becomes an object. A list becomes an array.

Does the YAML get uploaded?

No. Reading and conversion stay in this browser. No copy is sent to MegaToolkit. Close the tab and the text is gone.