The import screen wants a .json file. Your config, the one that works, the one the team has edited for months, is YAML. Rewriting it by hand in JSON would take an afternoon and invite typos in exactly the places you cannot afford them. Converting it takes a minute, as long as you know what changes and what to check before the tool sees the result.
This guide walks the job with the free YAML to JSON Converter on Ovatly: paste the YAML, convert, check the output against the original, and save it as JSON. It also explains the one error that should make you stop and fix your source file instead of pushing through.
Contents
- Quick answer
- Why the tool wants JSON in the first place
- What changes during conversion
- How to convert a YAML config to JSON, step by step
- Worked example: a small config, converted and checked
- How to check the output against the original
- When the converter refuses: duplicate keys
- Limitations and honest tradeoffs
- Common mistakes
- FAQs
- Conclusion
- References
Quick answer
Open the YAML to JSON Converter, paste your YAML config, and convert. Then check the JSON against the original: same keys, same nesting, same values, with timestamps rewritten as ISO date-time strings and comments gone. Save the result with a .json extension and give it to the tool. If the converter stops with a duplicate key error, fix the repeated key in your YAML. The converter runs locally in your browser, so the config never leaves your device.
Why the tool wants JSON in the first place
It is not stubbornness. JSON is strict and machine-friendly: every key and string is quoted, every value follows the same punctuation rules, and parsers in every language read it identically. YAML, for all its readability, depends on indentation and allows several styles for the same data, which is comfortable for people and more work for software.
So the tool is not asking you to abandon YAML. It is asking for a copy in the format it can parse with certainty. Your YAML stays the original you maintain; the JSON is a translation made for one consumer.
What changes during conversion
The data carries over. The presentation does not, in four specific ways.
Comments disappear. YAML allows comments and JSON has no comment syntax, so there is nowhere for them to go. Anything important written in a comment needs a new home.
Anchors are expanded. If your YAML defines a value once and references it from several places with an anchor, the JSON gives each place its own full copy. The file gets longer and stays correct.
Timestamps become strings. YAML recognises a timestamp as its own type. JSON has no date type, so timestamps come out as ISO date-time strings. Seeing a date turn into a quoted string is expected, not damage.
Duplicate keys stop everything. If a block names the same key twice, the converter raises an error instead of picking a winner; the refusal section below explains why.
How to convert a YAML config to JSON, step by step
- Open your YAML config and copy the file. Convert the file rather than a fragment, so nesting and shared values stay intact.
- Open the YAML to JSON Converter and paste the YAML in.
- Convert. If the file uses YAML 1.2 core features, as nearly every real config does, the JSON appears immediately.
- Run the checks in the next section but one: keys, nesting, values, timestamps.
- Save the output as a new file with a .json extension. Keep the YAML untouched beside it, and load the JSON into the tool that asked for it.
Worked example: a small config, converted and checked
Here is a small nested config in YAML, using a profile block:
editor:
name: Ana
age: 31
Converting it gives:
{"editor": {"name": "Ana", "age": 31}}
Check it the way the next section describes. Keys: editor, name and age are all present, three for three. Nesting: name and age sit inside editor, exactly as the indentation said. Values: Ana is still a string and 31 is still a number, not the text "31". If this config also carried a line like updated: 2026-11-27, the JSON would show that value as an ISO date-time string, and that change would be correct. A two-hundred-line config passes or fails by the same checks.
How to check the output against the original
Work through the converted file once, top to bottom, with the YAML open beside it.
- Keys. Every key in the YAML appears in the JSON, spelled the same. A missing key usually means the YAML indentation put it somewhere you did not intend.
- Nesting. Blocks that were indented together stay together as nested objects. This check catches quiet structural slips.
- Lists. Items appear in the same order. Order is data in a list, so a reordered list is a changed config.
- Values and types. Numbers are still numbers, booleans still booleans, and quoted strings still strings.
- Timestamps. Dates now read as ISO date-time strings. Confirm each one matches the date in the YAML.
Five minutes is the difference between a conversion you trust and one you hope is right.
When the converter refuses: duplicate keys
Eventually the converter will stop and report a duplicate key. It looks like a failure. It is the most useful thing the tool does.
A duplicate key means your YAML names the same key twice in one block:
name: Ana
name: Ana B
One of those values has to win and the other has to be silently lost. Many parsers make that choice without telling you, so your running config may already differ from what the file appears to say. The converter refuses instead of guessing, and never silently overwrites. Treat the error as a bug report on the source file: decide which value is right, delete the other line, and convert again. You have fixed a config bug that was hiding in plain sight.
Limitations and honest tradeoffs
The converter handles YAML 1.2 core features, which cover typical config files. A file built on YAML's exotic corners beyond that core may not convert cleanly here.
Conversion is one-way in spirit even though the tool runs both directions. The JSON has no comments and no anchors, so converting it back gives valid YAML with the same data, but not your original file with its notes and shorthand. Keep the YAML as the source of truth.
And conversion does not validate meaning. A config can convert and still contain a wrong value, because checking that the data makes sense is the consuming tool's job, not the converter's.
Common mistakes
- Saving the output with the wrong extension. JSON content in a file named .yaml, or the reverse, confuses every tool downstream. Match the extension to the content.
- Skipping the check because the file is small. Small files are where a quick check costs almost nothing.
- Editing the JSON afterwards. Fixes made in the converted copy vanish the next time you convert. Change the YAML, then convert again.
- Panicking at the timestamp change. A date becoming an ISO date-time string is the format working as designed. Verify it matches, then move on.
- Forcing past a duplicate key error. The error is the tool finding a real bug. Fix the source instead of looking for a converter that will guess quietly.
FAQs
Do I need to install anything to convert YAML to JSON? No. The YAML to JSON Converter runs in your browser, so you paste the YAML, convert, and copy or save the JSON. Nothing is uploaded, which makes it safe for config files that hold internal settings.
What should I check after converting? Compare the JSON against the original YAML: every key present, nesting unchanged, lists in the same order, and any timestamps rewritten as ISO date-time strings. That last change is expected.
Why did the converter stop with a duplicate key error? Because your YAML names the same key twice in one block. One of those values would have to win and the other would be silently lost, so the converter refuses instead of guessing. Fix the duplication in the source file, then convert again.
What happens to comments and anchors in my YAML? Comments do not appear in the JSON, because JSON has no comment syntax. Anchors are expanded, so each place that referenced a shared value gets its own full copy. The data is complete; the shorthand is gone.
Can I convert JSON back to YAML with the same tool? Yes. The converter works in both directions. That is handy when a tool exports JSON settings and you want a YAML file you can read and annotate by hand.
Conclusion
Converting a YAML config to JSON is a small job with one real risk: handing over a file you never checked. Paste, convert, compare keys, nesting and timestamps, and treat a duplicate key error as the favour it is. If you are still deciding which format a new file should live in, our comparison of YAML vs JSON for config files lays out the tradeoffs. For more in this series, see our Data and JSON Tools guides.
References
- The YAML specification, version 1.2.2: https://yaml.org/spec/1.2.2/
- Introducing JSON, the format's grammar and data types: https://www.json.org/json-en.html
- js-yaml, the YAML parser the converter is built on: https://github.com/nodeca/js-yaml