Omnikit
DevFilesMoneyAll tools
Ctrl K
Dev toolsFile toolsMoney calculatorsAll tools
HomeDeveloper toolsYAML to JSON
EnglishالعربيةবাংলাDeutschEspañolFrançaisPolskiPortuguêsРусский

YAML to JSON

dev

Convert YAML to JSON and JSON to YAML, with anchors resolved

Runs in your browser. Nothing you type is sent anywhere. Updated on 24 Oct 2026.

YAML is easier to write and JSON is easier to parse, so configuration moves between them constantly. Both directions work here, with anchors resolved so a reference becomes the value it points at. An indentation error is reported with its line number, so line 12 is where you look.

Next:
  • JSON Formatter & Validator Format, validate, minify and sort JSON with exact error positions
  • JSON to TypeScript Generate TypeScript interfaces or types from a JSON sample

How to convert YAML to JSON

1

Keep "YAML to JSON" selected, and paste YAML into the YAML pane.

2

Check the badge above the input: "Valid YAML" with the document count, or "Invalid YAML".

3

Choose 2 spaces or 4 spaces under Indent for the JSON output.

4

Click Copy JSON, or the download icon to save data.json.

About the YAML to JSON converter

This YAML to JSON converter turns YAML into formatted JSON as you type, and switches round to turn JSON into YAML. It resolves anchors, aliases and merge keys into full objects, turns a file with several documents into a JSON array, and points to the exact line and column when the YAML is not valid.

People reach for it when a tool only accepts JSON but the config lives in YAML: feeding a Kubernetes manifest to a script, checking what a Docker Compose file with shared anchors really expands to, or pasting an OpenAPI spec into a JSON-only validator. The reverse direction helps when you want to hand-edit a long JSON config in a friendlier format.

Parsing follows YAML 1.2, the current version of the standard, so yes and no stay strings rather than turning into booleans. Values JSON cannot store, such as .inf or binary data, are converted with a note. When writing YAML, strings that older 1.1 parsers would misread are quoted, which keeps the output safe for tools like PyYAML.

Everything runs in your browser; nothing you paste is uploaded, so secrets in a config stay on your machine. Choose two or four spaces of indentation. Ctrl+Enter copies the result. Related tools: JSON Formatter, JSON to TypeScript, CSV to JSON.

Frequently asked questions

How do I convert YAML to JSON?

Paste the YAML into the left pane. The JSON appears on the right as you type. Choose two or four spaces, then press Copy or Ctrl+Enter. Use the direction switch to convert JSON back to YAML.

Is my YAML uploaded to a server?

No. The conversion runs entirely in your browser, so configuration files holding passwords, API tokens or internal hostnames never leave your device and nothing is written to a server log. The tool is free, needs no signup, and puts no limit on how many files you convert.

What happens to a YAML file with several documents?

Each document, separated by a line with three dashes, becomes one item in a JSON array, in the same order. A file with a single document converts to that document's value on its own.

Are anchors, aliases and merge keys supported?

Yes. An alias such as *defaults is replaced by a full copy of the anchored value, and a merge key (<<: *defaults) copies its keys into the mapping, with keys written next to it taking priority.

Why is yes converted to the string "yes" and not true?

YAML 1.2, the current standard, only treats true and false as booleans. Older YAML 1.1 parsers also accepted yes, no, on and off. Write true or false if you mean a boolean.

How do I find an error in my YAML?

Invalid YAML shows the line, the column and a likely fix, such as replacing tabs with spaces, removing a duplicate key or closing a bracket. Fix that spot and the output appears straight away.

Still stuck? Ask about YAML to JSON and anybody who knows can answer. No account needed.

Common uses

  • JSON to YAMLTurn JSON into clean, readable YAML for configs
  • YAML ValidatorCheck YAML syntax and see the exact line and column of each error

Same job, other tools: Query String Parser – Split a URL query string into a table of decoded parameters · JSON to Serde Struct – Paste an API response and get serde structs ready for serde_json::from_str · TSV to JSON – Convert tab-separated values, such as a paste from Excel, into JSON.

On the related tools: Excel 1904 Date System Converter – Convert serials from Mac workbooks that use the 1904 date system, 1,462 days apart.

Related tools

All developer tools
Excel Date Serial ConverterExcel serial numbers such as 45292 to dates and back, 1900 or 1904 system, with timesJWK to PEM ConverterConvert a JSON Web Key to PEM and back for RSA, EC and Ed25519 keys, with the thumbprintJSON to Rust Struct ConverterTurn a JSON sample into Rust structs with serde derives, renames, Option and VecBase64 Encode & DecodeText and files to Base64 and back, with URL-safe mode and image previewUnix Timestamp ConverterUnix timestamps to dates and dates to timestamps, in any time zoneJSON to TypeScriptGenerate TypeScript interfaces or types from a JSON sampleCSV to JSONConvert CSV to JSON and JSON to CSV, with a table previewURL Encoder / DecoderPercent-encode or decode text and URLs, and see every part of a link

In the collection JSON Tools.

Was this tool helpful?
Omnikit

Small jobs, done in your browser. Free, fast and private. Files are never uploaded.

Files

  • Compress Image
  • Image to PDF
  • Merge PDF
  • Compress PDF
  • PDF to Word
  • Word to PDF

Dev

  • JSON Formatter & Validator
  • Base64 Encode & Decode
  • JWT Decoder, Verifier & Encoder
  • Password Generator
  • UUID Generator
  • Unix Timestamp Converter

Money

  • SIP Calculator
  • EMI Calculator
  • GST Calculator
  • FD Calculator
  • PPF Calculator
  • Lumpsum Calculator
EnglishالعربيةবাংলাDeutschEspañolFrançaisPolskiPortuguêsРусский
GuidesQuestionsAboutHow we checkLaw library (beta)PrivacyTermsDisclosureContactMore: Exam practice (UGC NET Paper 1)Runs in your browser. Nothing is uploaded. © 2026 Omnikit (theomnikit.com)