JSON

JSON to YAML Converter

Details

How to use JSON to YAML Converter

What the tool does, how to run it, and what to expect from the result.

How to convert JSON to YAML

YAML is the format of choice for configuration files (Kubernetes, Docker Compose, GitHub Actions, OpenAPI) mostly because it is readable and supports comments. Converting from JSON is the usual first step when you have machine-generated config and want something a human can review.

The conversion runs in your browser. Objects become indented mappings, arrays become dash-prefixed sequences, and values that contain YAML-special characters are quoted automatically. Values that merely look like booleans or numbers are not, so check those before you ship the file.

  • Paste valid JSON into the input box.
  • Read the YAML output, which uses two spaces of indentation per nesting level.
  • Scan for string values such as no, yes, on, off, or numbers with leading zeros, and add quotes around them by hand so a YAML 1.1 parser does not change their type.
  • Add comments to the converted file, since that is usually the reason to prefer YAML and the conversion cannot invent them.
  • Validate the result with the tool that will consume it, because a YAML file can be well-formed and still be wrong for its schema.
Tips

Getting a better result out of JSON to YAML Converter

Specific settings and thresholds, not general advice.

  • Watch out for string values that look like booleans. A JSON string of "no", "yes", "on", or "off" is emitted unquoted, and a YAML 1.1 parser (which includes many Ruby, Python, and older Go loaders) reads those as booleans. This is the famous Norway problem: the country code NO turns into false. If a value must stay a string, quote it yourself in the output.
  • The same trap applies to number-like strings. A JSON string of "007" or "1.10" is written without quotes and a YAML parser will read it as a number, dropping the leading zero or the trailing digit. Version strings and postcodes are the usual casualties.
  • YAML is indentation-sensitive and tabs are illegal in it. The output here uses two spaces per level. If you paste it into an editor that converts leading spaces to tabs, the file stops parsing, and the error message will not point anywhere near the real cause.
  • YAML is a superset of JSON, so any valid JSON is already valid YAML. If you are converting only so that a tool will accept the file, try feeding it the JSON first, because it may already work.
  • The output has no comments, because JSON has none to carry. The main reason people prefer YAML for configuration is comments and anchors, and a mechanical conversion gives you neither, so a converted file is a starting point rather than a finished one.
Limits

What JSON to YAML Converter does not do

The honest boundary, so you do not lose time finding it yourself.

  • It does not quote string values that look like booleans or numbers, which can change their meaning under a YAML 1.1 parser.
  • It does not quote or escape keys, so a key containing a colon, a hash, or a leading dash can produce YAML that will not parse.
  • It emits no comments, no anchors, and no aliases, so repeated structures are duplicated rather than referenced.
  • It produces a single document, with no support for the multi-document form separated by three dashes.
Reference

Terms used on this page

Short, plain-language definitions for the formats and settings above.

At a glance

Who JSON to YAML Converter is for

A quick way to understand who this helps, what it solves, and where it connects next.

Best fit

Developers, data engineers, and anyone converting between data formats.

Ideal for

Quick JSON to YAML conversion without a backend or install.

FAQ

Common questions

Short answers for the questions people usually have before trying a utility like this.

Is the JSON to YAML converter free?

Yes. It is completely free to use, with no signup, no account, and no paywall.

Do I need to install anything?

No. It runs in any modern browser on desktop or mobile, with nothing to download and nothing to configure.

Does it stay local?

Yes. Your data is converted entirely in your browser and never uploaded to a server.

My string value became a boolean in YAML. Why?

This is the Norway problem, and it is a property of YAML 1.1 rather than a mistake in the conversion. YAML 1.1 treats the unquoted tokens yes, no, on, off, y, and n as booleans, so a country code of NO or a config value of off silently changes type. YAML 1.2 fixed this, but many widely used parsers still implement 1.1. The safe move is to quote any string value that could be read as a boolean, and to check the output whenever your data contains two-letter codes or on and off switches.

Do I even need to convert, given YAML is a superset of JSON?

Often not. Every valid JSON document is by definition valid YAML 1.2, so a YAML parser will happily read your JSON file as it stands. The reasons to convert are human ones: YAML is easier to read and to review in a pull request, and it supports comments. If a tool is refusing your file, check whether the problem is really the format before you convert.

Why does my leading zero disappear?

Because the value was emitted without quotes and the YAML parser read it as a number. A JSON string of "007" becomes an unquoted 007 in the output, and a parser resolves that to the integer 7, or in YAML 1.1 possibly to an octal value. The same thing happens to version strings such as "1.10", which become the float 1.1. Postcodes, product codes, and phone numbers are the usual victims. Quote them in the YAML.

Can I use tabs to indent the result?

No. Tabs are explicitly forbidden as indentation in YAML, and this is one of the most common causes of a parse error that people cannot diagnose. The output uses two spaces per level. If your editor is configured to convert leading whitespace to tabs on save, turn that off for YAML files, or the file will break in a way whose error message points at a line far from the real problem.

Is my JSON uploaded to convert it?

No. The JSON is parsed and re-emitted as YAML by JavaScript running in your browser, so nothing is transmitted. Since the JSON people convert is often a Kubernetes manifest, a CI config, or an API response with real credentials in it, that is worth knowing.

Recommendations

You Might Also Like

Nearby tools from the catalog that fit the same job or workflow.

Cleanor app

Do it all on your device

Cleanor puts these tools in one app: compress and convert images, video, and audio, work with PDFs, and scan text right on your device. Plus free up storage and clear inbox clutter with Email Cleaner. Start with a free trial.

  • iPhone
  • Android
  • Macsoon
  • Windowssoon