YAML to JSON Converter

Add a .yaml or .yml file and get a JSON file back. Comments are dropped and a few values change type, so read the list below before you rely on the result.

To convert yaml to json, add the .yaml or .yml file, keep JSON as the output and download the result. In our test, a 320 B YAML file with two documents became a 450 B json array of two objects in 2.8 seconds. Comments were dropped, NO became false, 01234 became 668 and .nan came out as a bare NaN, which strict JSON does not allow.

Transfers use HTTPS, and files converted on the free tier are deleted after 24 hours, so the result is not a long-term archive. Quality depends on the source file, so open the JSON file once before you share it.

FromYAMLLossless

YAML (YAML Ain't Markup Language)

A human-readable data format that uses indentation instead of braces, allows comments, and can reuse a block through anchors and aliases. It is common in configuration files for Kubernetes, Docker Compose and CI pipelines. The current spec is revision 1.2.2 from October 2021, and it is a superset of JSON. Files usually end in .yaml or .yml.

ToJSONLossless

JSON (JavaScript Object Notation)

A text format for structured data built from objects, arrays, strings, numbers, true, false and null. It has no comments and no date type, and it forbids NaN and Infinity. It must be UTF-8 when exchanged between systems, and it is the usual format for web APIs. It is defined by RFC 8259 and ECMA-404, and files end in .json.

A 320 B YAML file with two documents and a single-document 160 B file, converted on indox.org

YAMLthe test file, 2 documents, with edge cases
320 B
JSONfrom indox, array of 2 objects, 2.8 s in our test
450 B
YAMLsingle clean snippet, 1 document
160 B
JSONfrom indox, valid JSON, 3.2 s in our test
274 B
Measured on indox.org on 5 November 2026: two YAML files we wrote and the JSON we downloaded from each. The first one has two documents and the edge cases listed on this page; the second is a short, clean snippet.

Why use indox to convert YAML to JSON?

Works with .yaml and .yml

Both extensions are the same format, so there is no separate tool for either. Add the file you have and you get a .json file named after it.

Several documents in one file

A file split by --- lines is read as separate documents. In our test, two documents came back as one JSON array with two objects, and a single document stays a plain object.

Anchors and merge keys are resolved

Shared blocks that use &defaults and <<: *defaults are written out in full where they are used, so the JSON needs no reference support to read them.

Order and text are kept

Keys stayed in the order of the source, and non-English text is written as it is instead of as escape codes. The output uses two-space indentation, LF line endings and no byte order mark in our test.

Nothing to install

The conversion runs on indox servers, so it works in a browser on any system, without Python, yq or a code editor extension.

What happens to your YAML

Stays

  • Your original YAML file, which is not touched
  • The keys, values and nesting of plain mappings, lists and strings
  • The order of keys, as written in the source
  • Very large integers, such as 12345678901234567890, kept exact in our test

Changes

  • Comments: dropped
  • Anchors, aliases and merge keys: expanded into copies
  • Words like NO and yes: read as false and true
  • Zero-padded numbers: 01234 became 668
  • Dates and timestamps: written as text
  • Several documents: combined into one array
  • .nan: written as NaN, which makes the JSON invalid

How do I convert YAML to JSON online?

  1. 1

    Add your YAML file

    Drop the .yaml or .yml file on the box or choose it from your device. Check first that it is plain YAML text with spaces for indentation, since the format does not allow tabs.

  2. 2

    Keep JSON as the output and convert

    Make sure JSON is the output format, then start the conversion. In our test it took 2.8 seconds from the click to Completed, with no sign-in.

  3. 3

    Download the JSON and check the values

    Open the file and look at any NO, yes, zero-padded number, date or .nan from your source. Run it through a JSON validator if another program will read it strictly.

What do I get from indox's YAML to JSON converter?

You hand over a YAML or YML file and take away JSON, for tools and code that read only JSON. The page lists what the conversion drops or changes, with values we measured, so you know before you convert whether the result fits the job.

  • One JSON file from the YAML you add, in a few clicks
  • Nothing installed and no account needed in our test
  • Edge cases stated up front: comments, octal-looking numbers, booleans, dates and NaN
  • Your original YAML file is left as it was
The indox YAML to JSON converter: drop a file or choose one to convert it to JSON

What are the limits for YAML to JSON?

Size

The upload box shows the live size limit before you add a file. Signing in raises it; a paid plan does not change it.

Formats

YAML in, JSON out. Pick another output on the converter if you need a different format.

Privacy

Files are encrypted in transit over HTTPS and processed on indox infrastructure.

Deletion

Free-tier files are kept for 24 hours after the job finishes, then deleted automatically.

Limits worth knowing

  • Comments cannot be kept. JSON has nowhere to put them, so keep the YAML as your commented source and treat the JSON as a generated copy.
  • There are no options on the converter. We saw no setting for indentation, key sorting, quoting or YAML version, so the output follows the fixed behaviour described on this page.
  • indox uploads and converts the file on its servers, not in your browser. Do not upload YAML that holds passwords or keys you would not share.
  • The result is not guaranteed to be strict JSON. A .nan or .inf value is written as NaN or Infinity, which RFC 8259 forbids. Replace such values in the YAML before converting.
  • We tested one small file with two documents and one single-document file. We did not test custom tags such as !!binary or !!set, recursive aliases, files that are not UTF-8, very large files, or the message shown for invalid YAML.

When the result is not what you expected

What you seeWhyWhat to do
A value turned into false or trueYAML 1.1 style reading treats NO, yes, on and off as booleansQuote the value in the YAML, for example "NO", and convert again
A number changed, such as 01234 to 668A leading zero is read as octalQuote the value so it stays text
A date is text with a space in itJSON has no date type and the timestamp is written as a stringParse the string in your own code or write the date as text in the YAML
Another program rejects the JSONThe file holds NaN, which RFC 8259 does not allowRemove .nan and .inf from the YAML, or use null
I got an array and expected an objectThe file had several --- documentsSplit the YAML into one file per document, or read the first item of the array
My comments and anchor names are missingJSON cannot store themKeep the YAML as the source and regenerate the JSON when it changes
I need the file as YAML againThis tool goes one wayUse JSON to YAML, knowing comments will not return

What do the free and paid plans add?

Free

  • All converters
  • Daily credit refresh
  • Email support

Basic

  • Access to all features
  • AI Extract
  • Priority conversions
  • Email support
Highest priority

Premium

  • Everything in Basic
  • Highest priority queue
  • Priority support

Pay-As-You-Go

  • No subscription
  • Credits never expire
  • Opt-in auto-refill
  • Access to all features
See prices

YAML vs JSON: what is the difference?

Compared onYAMLJSON
CommentsAllowed with #Not part of the format
TypesReader decides: NO, yes and 01234 can become other typesStrings, numbers, true, false, null, objects, arrays
ReuseAnchors, aliases and merge keysNone, a value is written out each time
DatesTimestamp types in the specNo date type, so dates are strings
Non-numbersWritten as .nan and .infNaN and Infinity are not allowed
Typical useConfiguration written by peopleData exchanged between programs and web APIs

Who can use a YAML to JSON converter?

  • Developers feeding a JSON-only tool

    An API, a script or a front-end app that accepts only JSON cannot read your config as YAML. A converted copy lets you test it without installing a library. Check booleans and zero-padded values first.

  • API authors with OpenAPI or Swagger files

    A spec kept as YAML is sometimes needed as JSON for a gateway, a code generator or an import form. Plain mappings, lists and strings convert cleanly. Dates and non-string keys need a look.

  • DevOps users with multi-document manifests

    A file with several --- documents, like a Kubernetes manifest set, becomes one JSON array. Each object is one document, in the original order.

  • People without Python or yq at hand

    If you only need one file converted and have no runtime to run a script, a browser tool does the job. For many files or a build step, a library in your own code is the better fit.

When to use it

  • Turning an OpenAPI or Swagger YAML file into JSON for a tool that imports only JSON.
  • Giving a JSON copy of a config file to a script, API or JavaScript app.
  • Checking what a multi-document YAML file looks like as a list of JSON objects.
  • Seeing how your YAML values are typed, such as whether NO or 01234 is read as text or as another type.
  • Preparing data for a JSON Schema validator that expects JSON input.

Where can I read more about converting files?

Do it all with indox

View all 94 tools

YAML to JSON FAQs

How do I convert YAML to JSON?

Add your .yaml or .yml file to the converter, keep JSON as the output and download the result. In our test a small file finished in 2.8 seconds without a login.

Are YAML comments kept in the JSON?

No. JSON has no comments, and the YAML specification says comments must not affect the data. Every # comment was gone in our test. Keep the YAML file if you need the notes.

What happens to anchors, aliases and merge keys?

They are expanded into copies. In our test a <<: *defaults merge was written out in each place that used it and the anchor name did not appear in the JSON. The key that held the defaults stayed in the output as well.

What happens to a YAML file with several documents?

A file split by --- becomes a JSON array with one object per document. In our test two documents gave an array of two objects. A file with one document gives a plain object, not an array.

Why did NO become false and 01234 become 668?

The reader follows the older YAML 1.1 rules, where NO, yes and similar words are booleans and a leading zero means octal. Put quotes around such values in the YAML, for example "NO" and "01234", and they stay text.

How are dates and timestamps converted?

They become strings, because JSON has no date type. 2024-01-15 stayed 2024-01-15 and 2024-01-15T10:30:00Z became 2024-01-15 10:30:00+00:00 in our test, with a space instead of a T. Parse them in your own code if you need a specific format.

Is the JSON always valid?

Not always. In our test .nan came out as a bare NaN, and a strict parser rejects that. A file without such values was valid JSON in our second test. Replace .nan and .inf in the YAML first.

Can I convert JSON back to YAML?

Yes, with [JSON to YAML](/convert/json-to-yaml). Comments and anchors removed on the way to JSON cannot come back, so a round trip will not match the original text.

How do I convert OpenAPI or Swagger YAML to JSON?

Add the spec file as you would any other YAML file. Check that response codes written as numbers, such as 200, are what your tool expects, because every key becomes a string in JSON.