YAML to JSON

Check a YAML file and see it as JSON. Nothing leaves your browser.

Your files stay with you. Your files never leave your browser. This tool runs on your device: nothing is uploaded to our servers, so there is nothing for us to store or see.

How to use it

  1. Paste YAML or open a .yaml / .yml file.
  2. Choose the JSON layout.
  3. Copy the JSON or download data.json.

Where it helps

Checking configs

Find the indentation slip that breaks a CI or Docker file.

Feeding APIs

Turn a YAML spec or fixture into JSON for code or an API.

Understanding YAML

See exactly how YAML anchors and lists are read.

Good to know

  • Stays in your browser

    Your text is processed on your device and never sent to our servers.

  • Mind live secrets

    Avoid pasting production keys or tokens on a shared computer.

  • Spaces, not tabs

    YAML structure must use spaces.

  • Quotes for odd values

    Quote values like yes, no or 08 if they must stay text.

Questions people ask

How do you convert YAML to JSON and catch indentation errors?

Paste YAML or open a .yaml or .yml file, choose the JSON layout and copy the result or download data.json. If the YAML is invalid, the error names the line and column, which usually points to a tab or a misaligned item. Files with several documents separated by --- become a JSON list.

  • 1.2 YAML core schema. Via js-yaml.
  • Line:col Errors. Find bad indents.
  • --- Multi-document. Returned as a list.
  • Safe mode No code runs. Parser can't execute.
Why do I get an indentation error?
YAML uses spaces, never tabs, to show structure, and items at the same level must line up exactly. The error names the line and column so you can fix the spacing. Editors that turn tabs into spaces and show whitespace help prevent the problem from coming back.
Is this safe for files with secrets?
The file is read in your browser by a parser in safe mode that can't run code, and nothing is sent to our servers. Even so, avoid pasting production secrets on a shared computer, and use placeholders in examples you share with colleagues or in support tickets.
What about files with several documents separated by ---?
They're returned as a JSON list with one item per document, in the same order. Kubernetes manifests often bundle a deployment, a service and a config map in one file this way, and the list makes each one easy to inspect separately. A file with a single document gives a single JSON value.
Which YAML version is supported?
The widely used YAML 1.2 core schema, through the open-source js-yaml library. That covers mappings, lists, block and folded strings, anchors and aliases. Rare features such as custom tags aren't supported, and the tool reports them rather than guessing what they mean. That covers almost every real configuration file.
Why did 'yes' or 'on' become true?
Older YAML 1.1 treated yes, no, on and off as booleans, and some tools still do. The 1.2 core schema used here only treats true and false that way, but quoting such values is the safe habit when the file will be read by other tools too.
Why did my version number change?
Unquoted values such as 1.10 are read as numbers, so 1.10 becomes 1.1 in JSON. Values like 08 can also be read unexpectedly. Put quotes around version numbers, postcodes and IDs in your YAML so they stay as text, exactly as you wrote them. The JSON output shows the problem clearly.
How are anchors and aliases handled?
Anchors (&name) and aliases (*name) are resolved, so the JSON contains the full repeated content wherever an alias was used. Merge keys that combine mappings are expanded too. That shows you exactly what an app will see after parsing a file that reuses blocks. That's often where surprises hide.
Can I use it to check a GitHub Actions or Docker Compose file?
Yes. Paste the file to confirm it parses, and read the JSON to check that lists, keys and nesting are what you expect. It checks YAML syntax, not whether the settings are valid for that tool, so the tool's own docs or a dry run is still the final check.
Does it keep comments?
No. JSON has no comments, so YAML comments are dropped in the conversion. Keep your original YAML file as the source if the comments matter. The JSON is best treated as a generated output for an API, a script or a quick check of the structure.
What happens to multi-line strings?
Block strings written with | keep their line breaks, and folded strings written with > join lines with spaces, following the YAML rules. In the JSON, line breaks appear as \n inside the string. That's a useful way to check exactly how a long description or script will be read.
Can I choose the JSON indentation?
Yes. Pick two spaces, four spaces or a minified single line. Use indented JSON for reading and checking, and minified JSON when you need to paste it into a request, an environment variable or a database field that expects compact text. Two spaces is the default.
How large a YAML file can I convert?
Files of a few megabytes convert comfortably, since parsing happens in your browser. Most configuration files are much smaller. For huge data files, YAML is rarely the right format anyway, so consider exporting JSON directly from the system that produced the data. Errors still show the exact line and column.
Is my YAML uploaded?
No. Parsing happens in your browser and nothing reaches our servers, and nothing is stored after you close the page. That keeps internal hostnames, settings and environment details private, which matters for infrastructure and deployment files. You can use it as often as you like, with no account or sign-up needed.
Does it work on a phone?
Yes. You can paste YAML or open a .yml file on a phone and read the JSON result. It's handy when a build fails and you want to check a config file quickly while you're away from your laptop. Everything runs locally in the mobile browser.
Is the YAML to JSON converter free?
Yes. It's free with no sign-up and no limit on use. It's one of the free developer tools from Marketiism, together with the JSON to YAML converter and the JSON formatter. Marketiism builds software for small businesses in India. Use it as often as you need, for any project.

Want this inside your own account?

Marketiism keeps your invoice numbers, GST reports, UPI payment links and WhatsApp reminders in one place. Leave your details and we'll call to set it up for your business, or start the trial yourself.

Start free trial

We use this only to contact you about Marketiism. No spam.

More Developer tools

JSON to YAML

Convert JSON into clean YAML for configs, Kubernetes and CI files.

JSON Formatter

Format, validate and minify JSON, and see exactly which line has a mistake.

CSV to JSON

Convert CSV rows into a JSON list, with numbers and true/false detected.

JSON to CSV

Turn a JSON list of records into CSV for Excel or Google Sheets.

XML Formatter

Pretty-print or minify XML and find unclosed or mismatched tags.

Try it on your own business for two weeks.

14 days free, no card. If you get stuck setting up WhatsApp, we'll get on a call and do it with you.