TFT

Convert YAML to JSON Online

Quickly and accurately convert your YAML configuration files into JSON format. This free tool preserves your data structure and offers formatting options for clean, usable JSON output.

YAML to JSON Converter

Convert YAML data to JSON format instantly

How it works

Paste YAML into the left box, or press Load Example to see a sample, then click Convert to JSON. The converted text appears on the right. You can copy it to the clipboard or download it as converted.json. The conversion happens in your browser, so your configuration is not sent to a server.

The Prettify JSON output checkbox controls formatting. When it is on, the result uses two-space indentation and is easy to read. When it is off, you get compact single-line JSON, which is handy for pasting into a request body or an environment variable.

The converter reads YAML by indentation. Nested keys become nested objects, and dashed lines become arrays. Comment lines that start with # and blank lines are ignored.

How values are typed

Plain values are converted to JSON types using a few simple rules.

  • null and ~ become null.
  • true and false (in lower case, Title case or upper case) become booleans.
  • Whole numbers and decimals such as 30 or -4.5 become numbers.
  • Quoted text has its outer quotes removed and stays a string, so "123" ends up as the string 123 rather than a number.
  • Everything else is kept as a string.

What to know before you rely on it

This is a lightweight converter built for everyday configuration files, not a full YAML 1.2 parser. It works well for the common shape of key: value pairs, nested maps and simple lists. Some YAML features are not supported, including anchors and aliases (& and *), multi-line block scalars (| and >), inline flow collections such as [a, b] or {a: 1}, multiple documents separated by ---, and complex lists of nested objects. Check the JSON against your source if your file uses these.

The tool does not validate your YAML against the spec. Indentation mistakes may produce output that looks plausible but is not what you intended, so scan the result before you use it. If you need to check syntax first, the YAML Validator or YAML Linter on this site can help.

When it is useful

  • Turning a settings or config file into JSON for an API or a tool that only accepts JSON.
  • Checking how a YAML snippet will be structured as objects and arrays.
  • Creating test fixtures or mock payloads from YAML you already maintain.
  • Moving data between formats, for example before running the result through a JSON formatter.

Frequently asked questions

Is my YAML uploaded anywhere?

No. The conversion runs in your browser, and nothing is sent to a server.

Why did my number turn into a string?

Values in quotes are always treated as strings. Remove the quotes if you want a number.

Are comments kept?

No. JSON has no comment syntax, so lines starting with # are dropped.

Can I convert JSON back to YAML?

Yes, use the JSON to YAML Converter linked below.