Skip to main content

YAML to JSON converter

Convert YAML configs to JSON

No watermarkFree & unlimited
Mode
Input (YAML)
Output (JSON)
All processing happens in your browser. No data is sent to any server.

js-yaml reads your document under its default schema, which is the safe one: ordinary scalars, sequences and mappings are accepted while custom application tags are rejected rather than executed. Anchors, aliases and merge keys are resolved as the document loads, so a config built out of shared blocks arrives fully expanded. Comments have no representation in JSON and are dropped. The resulting value is printed with two-space indentation. One document per conversion: a stream separated by three dashes is refused rather than silently truncated.

Key facts about YAML to JSON converter

Key facts about YAML to JSON converter
Loaderjs-yaml 4.1 load with the default safe schema, so tags such as a JavaScript function type are refused.
SpecificationYAML 1.2 core schema. Only true and false are booleans, so yes, no, on and off stay strings.
Anchors and aliasesResolved and expanded inline, so a block reused three times appears three times in the JSON.
Merge keysThe double angle bracket merge is applied during loading, and the merged keys appear directly on the object.
Multi-document streamsNot accepted. A file with three-dash separators fails with an error about expecting a single document.
CommentsDiscarded, because JSON has no syntax for them. Move anything important into a real key first.
TimestampsAn ISO-style date becomes a Date during loading and is serialised into the JSON as an ISO 8601 string.
Indentation rulesTabs are illegal as YAML indentation, so a file indented with tabs fails with a position in the error.
Multi-line scalarsLiteral and folded blocks are resolved into ordinary strings with the newline handling each style implies.
Output formatJSON with two-space indentation, key order as the document declared it, no trailing newline added.
ExtensionsBoth .yaml and .yml are accepted by the picker, and paste and convert works without a file at all.
Error detailFailures report the js-yaml message, which names the line and column where parsing stopped.

What happens to your file

Config files are exactly the kind of document you should not paste into a remote service, and nothing here is transmitted. Pasted YAML stays in the input panel, an uploaded file is read on your device with the File API, and the copy of js-yaml bundled into this page does the loading in the same tab. Because the safe schema is in force, no tag in the document can cause code to run. The JSON is serialised locally and offered as clipboard text or as a download.

About this tool

  1. 1

    Pick a mode

    Paste and convert opens by default; switch to file upload for a .yaml or .yml file on disk.

  2. 2

    Split multi-document files

    If the file contains several documents separated by three dashes, convert them one at a time.

  3. 3

    Convert

    js-yaml loads the document, expanding anchors and merges, and the value is printed as indented JSON.

  4. 4

    Check the ambiguous values

    Look at anything that was written unquoted, particularly version numbers, times and country codes.

  5. 5

    Copy or download

    Copy the JSON, or save a .json file when you converted from an uploaded document.

Specs & compatibility
Input and outputTakes .yaml and .yml (text/yaml) and returns the JSON as a blob with the application/json type, named after the file you dropped in.
Enginejs-yaml 4.1.1 bundled into the page loads the YAML and JSON.stringify prints it with two-space indentation - no worker and no network call.
ModesBoth modes: paste the YAML in and copy the JSON straight back out, or hand over a file and take the JSON as a download.
Batch and capsTwenty YAML files per run at 500 MB each; several JSON results are zipped in page memory as converted-json-files.zip.
Browser and deviceYAML to JSON needs only the File API, a Blob download and the parser already in the bundle, so every current browser behaves the same and the page keeps working with the network off.
  • A Kubernetes manifest file usually holds several documents. Split on the three-dash separators and convert each part, or the load will fail on the first boundary.
  • Quote anything that must stay a string: a version like 1.10 loads as a number and loses its trailing zero, and a code such as NO stays text only because YAML 1.2 no longer treats it as false.
  • Anchors make YAML compact and JSON cannot express them, so expect the output to be longer than the input when a file reuses blocks heavily.
  • If loading fails on a line that looks fine, check for tab characters. Editors that insert tabs silently break YAML indentation.
  • Comments carry real information in most config files. Copy them somewhere before converting, because they are gone from the JSON for good.
  • Convert a Docker Compose or CI pipeline file into JSON so a script or a validator can work with it programmatically.
  • Turn an OpenAPI description written in YAML into the JSON form that many documentation and codegen tools expect.
  • Inspect a deeply nested configuration in a format where every level is explicitly bracketed and easier to diff.
The loader used here returns a single value and throws when the stream contains more than one document, which is what the three-dash separator introduces. Kubernetes manifests and some CI configs routinely bundle several documents this way. Split the file at the separators and convert each document on its own, then combine the JSON results into an array if you need them together.
No, and this surprises people who remember YAML 1.1. Under the 1.2 core schema that js-yaml 4 applies, only true and false are boolean literals, so yes, no, on and off load as ordinary strings. If you were relying on the old behaviour, change those values to true and false in the source, because the converter will not guess your intent.
They are resolved while the document loads, so the JSON contains a full copy of the referenced block at every point it was used. JSON has no mechanism for references, so expansion is the only faithful option. The practical consequence is that a config which stays short through heavy reuse can produce a noticeably larger JSON document.
They cannot be. JSON has no comment syntax at all, so every hash-prefixed line and every trailing note is discarded during loading and never reaches the output. In configuration files those comments often hold the reasoning behind a value, so copy them somewhere else before converting if the JSON is going to become the source of truth.
A scalar matching the YAML timestamp pattern is loaded as a Date object, and serialising a Date to JSON produces an ISO 8601 string in UTC. That means a local date written without a zone comes out normalised, which can shift the apparent day. Quote such values in the YAML if you need the exact text you wrote to survive.
The loading is done with the default safe schema, which refuses custom tags including the ones that could construct arbitrary objects, so a malicious tag causes an error rather than an effect. Beyond that, the document never leaves your browser, so even a config full of credentials is not exposed by using this page. Nothing is logged or stored.
View all

Need the opposite? Try JSON to YAML

Updated

We use anonymous analytics to improve ToolChamp. No personal data is stored or sold. Privacy Policy