Developer Tools
Convert YAML to JSON
Convert YAML config text to formatted JSON locally in your browser.
Direct Answer
Use the YAML To JSON Converter when a YAML config or document needs to be checked, processed, or reused as JSON.
What YAML Has That JSON Does Not
YAML supports several features with no JSON equivalent, so converting to JSON either expands them into plain values or drops them, and it helps to know which is happening to your file.
- Comments are removed entirely since JSON has no comment syntax
- Anchors and aliases are expanded into full duplicated JSON values
- Merge keys are resolved and merged into the referencing mapping
- Multi-document YAML, files separated by a document marker, needs to become an array of JSON values or multiple files
Unquoted YAML Values That Convert Unexpectedly
YAML's relaxed, unquoted scalar syntax lets a plain-looking string get interpreted as a different type, which becomes visible only once you see the resulting JSON.
- Unquoted yes, no, on, off, true, and false can all be read as booleans depending on the YAML version
- A bare date-looking value like 2024-01-05 can be parsed into a timestamp type rather than kept as a string
- A value like 1_000 can be interpreted as an underscored number instead of a plain string
- A country code like "NO" for Norway is the classic example of the boolean-parsing surprise
How to Use YAML To JSON
- Paste or type your content into the input box.
- The transformed result appears instantly in the result panel below.
- Click Copy result to copy the output to your clipboard.
- Download .txt saves the transformed text as a file.
- Reset clears everything and lets you start over.
Reference
| Feature | Details |
|---|---|
| Purpose | Transform pasted text into a cleaner or different format. |
| Input | Text, lines, lists, or copied content. |
| Result | Transformed text ready to copy or download. |
| Best for | Cleanup, formatting, list preparation, and copy-paste workflows. |
| Category | Developer Tools |
| Works on | Desktop, tablet, and mobile browsers |
Common Ways People Search for This
People do not always know the exact tool name. These are plain-language searches this page is designed to answer:
- how do i convert yaml to json
- help me convert yaml to json
- easy way to convert yaml to json
- simple way to convert yaml to json
- website that can convert yaml to json
- app that can convert yaml to json
- tool that can convert yaml to json
- free website to convert yaml to json
A Focused YAML To JSON Alternative
People looking for alternatives to JSONLint, Code Beautify, FreeFormatter, Browserling often want a simpler workflow. This yaml to json focuses on the task first: clear inputs, a visible result, useful related tools, free access, and no account requirement.
- Puts the tool input and result near the top of the page
- Free to use with no account or payment step
- Includes focused explanations and related tools
- Designed to avoid misleading download buttons and forced interstitials
Useful Related Tools
Frequently Asked Questions
How do I turn a YAML config into JSON?
Paste the YAML into the converter and it will parse the indentation-based structure into an equivalent JSON object or array. Any comments in the YAML are dropped since JSON has no way to represent them.
Why does my YAML string "no" turn into false in the JSON output?
This is the well-known Norway problem: YAML 1.1 treats unquoted words like yes, no, on, off, true, and false, in various cases, as booleans, so a country code or abbreviation written as NO gets silently converted to false. Quote the value explicitly in the source YAML, or use a YAML 1.2 parser, which narrows boolean parsing to only true and false, to avoid this.
Why did my YAML date field become a strange object or number in JSON?
Many YAML parsers automatically recognize unquoted values matching a date pattern, like 2024-01-05, and convert them into a native timestamp type rather than a plain string, which then serializes to JSON differently than the literal text you typed. Quote date-like values in the YAML source if you need them preserved as plain strings.
Does converting YAML to JSON preserve anchors and aliases?
No, JSON has no equivalent concept, so anchors and their aliases are resolved during conversion, meaning the referenced content is fully expanded and duplicated everywhere it was aliased. This can make the resulting JSON noticeably larger than the compact YAML if the same block was reused many times via aliases.
Why does my YAML fail to convert with an indentation error?
YAML uses indentation to define structure, and it does not allow tab characters for indentation, only spaces, so a file with mixed tabs and spaces, or inconsistent indentation width between sibling items, will fail to parse. Check for tabs, often invisible in an editor, and make sure sibling keys line up at exactly the same column.
Are YAML comments included when I convert to JSON?
No, comment lines are discarded entirely because JSON has no syntax to represent them. If a comment contains information you need to keep, such as documentation for a config value, it needs to be moved into an actual field before converting.
What happens to multi-document YAML files when converting to JSON?
A file with multiple documents separated by a document marker needs to be handled explicitly, either by converting each document to its own JSON value and combining them into a JSON array, or by converting only the first document if your tool does not support multiple documents. Check your converter's behavior, since silently converting only part of a multi-document file is a common source of missing data.
Why does my YAML merge key not appear in the resulting JSON?
A merge key is a YAML-specific feature for combining one mapping's keys into another; a compliant converter resolves it and produces a flat JSON object with all the merged keys present, but the merge key syntax itself does not carry over since JSON has no equivalent shorthand. If merged keys are missing entirely rather than resolved, your converter may not support this feature.
Why do numbers with underscores in my YAML, like 1_000_000, look different in JSON?
Some YAML parsers support underscore-separated numbers as a readability feature, similar to some programming languages, and they get resolved to a plain number like 1000000 in JSON, which has no underscore syntax for numbers at all. Quote the value as a string in the YAML if you need the underscores preserved as literal text.
Can converting YAML to JSON handle custom type tags?
Standard converters support YAML's built-in core tags for strings, integers, and booleans, but not custom or language-specific tags, which have no defined JSON equivalent and will either cause an error or be converted to a plain string of the raw tagged value. Custom tags generally need to be resolved by the specific application that created them before converting.
Why does my YAML list item ordering change after converting to JSON?
It should not; YAML lists and JSON arrays both preserve order, so if you see a different order in the output, check whether the converter sorted keys within objects, which is unordered in both formats, rather than reordered a sequence, since object key order is not guaranteed by either specification even though most tools do preserve it in practice.
Does YAML to JSON conversion handle deeply nested indentation correctly?
Yes, as long as the indentation in the source YAML is consistent, since YAML's structure is entirely defined by indentation level rather than explicit closing symbols. Deeply nested YAML with inconsistent spacing between sibling levels is the most common cause of a parse error on complex files.
What is the YAML To JSON?
The YAML To JSON is a free online utility for developer formatting, validation, and debugging tasks. It changes pasted text into the requested format and shows the transformed output ready to copy.