Skip to content
TinySolve

YAML to JSON

Convert YAML into JSON, with indentation errors reported by line.

Runs in your browser — nothing you type is sent anywhere

Parsed with the JSON-compatible schema, which refuses the YAML tags that amount to arbitrary object construction — so pasting a document from somewhere you do not control is safe.

JSON

The result appears here as you type. Nothing is sent anywhere — the work happens in this page.

About the YAML to JSON

Most configuration is written in YAML and most tooling consumes JSON, so this conversion happens constantly — usually when you want to feed a config file into something that only speaks JSON, or when you need to check what a YAML document actually parses to.

That second case is the more useful one, because YAML has a reputation for surprising people. Indentation defines structure, tabs are forbidden entirely, and a value that looks like text can be read as something else: the word no becomes a boolean in older YAML versions, and a version number like 1.10 becomes the number 1.1. Converting to JSON shows you exactly what the parser saw rather than what you meant.

Errors are reported with a line number, because an indentation mistake several levels deep is otherwise very hard to find. The message is trimmed to one readable line rather than the multi-line excerpt the parser produces by default.

Parsing uses the JSON-compatible schema, which refuses the YAML tags that amount to arbitrary object construction. That distinction matters if you are pasting a document from somewhere you do not control — the permissive schema is a genuine security problem in some YAML libraries, and there is no reason to accept those constructs here.

Everything runs in your browser, so nothing you paste is transmitted.

How to use the YAML to JSON

  1. Paste your YAML

    A config file, a snippet, or a whole document. Conversion happens as you type with nothing to submit.

  2. Read the JSON

    The result shows exactly what the parser understood, which is the quickest way to spot a value being read as the wrong type.

  3. Fix any error by line

    An invalid document reports the line it failed on, which is usually an indentation problem or a stray tab.

  4. Copy or download

    Copy the JSON, or download it as a .json file. You can minify it first if it is going into a request body.

Frequently asked questions

Why does my YAML fail with an indentation error?
Almost always a tab character, which YAML forbids for indentation, or a level that does not line up with its siblings. The error gives the line number so you can go straight to it — look for mixed tabs and spaces first.
Why did my value become a boolean or a number?
YAML infers types from the text. Bare yes, no, on and off are read as booleans by older parsers, and 1.10 becomes the number 1.1, losing the trailing zero. Quote the value to keep it a string. Converting to JSON is a quick way to spot this happening.
Is it safe to paste a YAML file I did not write?
Here, yes. Parsing uses the JSON-compatible schema, which refuses the tags that let a YAML document ask for arbitrary object construction. Those tags are a genuine security problem in some libraries and there is no reason to accept them.
Can it handle a file with several documents in it?
Only the first document is converted. A file separated by --- markers contains multiple documents, and JSON has no way to represent more than one at a time, so split them before converting.
Are comments preserved?
No, and they cannot be. JSON has no syntax for comments, so anything after a hash in your YAML is dropped during conversion. That is a limitation of the format rather than of this tool.