Home › Developer Tools › YAML to JSON Converter

YAML to JSON Converter

Paste YAML and valid JSON appears instantly, pretty-printed or minified. If the YAML has a mistake, the faulty line is highlighted and the message tells you what's wrong. Everything runs in your browser.

Last updated:

JSON output

      
Converts automatically as you type. Comments are not kept because JSON has no comments.
Advertisement
Advertisement

How to use the YAML to JSON Converter

  1. Paste your YAML into the left box, upload a .yaml or .yml file, or click Sample.
  2. Fix any errors. The status bar shows the line and column of the first problem and the line is highlighted in red. Click Go to error to jump there.
  3. Choose Pretty or Minified JSON and the indentation you prefer.
  4. Several documents? Files with --- separators are converted to a JSON array with one item per document.
  5. Copy or download the JSON.

How YAML values become JSON

YAMLJSONNotes
name: web{"name": "web"}Plain scalars are strings unless they look like a number, boolean or null
port: 8080{"port": 8080}Numbers stay numbers; quote them ("8080") to keep a string
debug: false{"debug": false}YAML 1.2 booleans are only true and false
value: ~ or value:{"value": null}~, null and an empty value are all null
- a
- b
["a", "b"]Block sequence; [a, b] flow style works too
text: | block"line 1\nline 2\n"Literal block keeps line breaks; > folds them into spaces
date: 2026-10-19"2026-10-19T00:00:00.000Z"Unquoted dates are timestamps; quote them to keep the original text
<<: *defaultsMerged keysAnchors, aliases and merge keys are expanded

Fixing common YAML errors

  • Bad indentation: sibling keys must start in exactly the same column and children must be indented further than their parent. Use spaces only; this editor inserts two spaces when you press Tab.
  • Missing space after the colon: key:value is read as one string. Write key: value.
  • Special characters: values that start with @, `, *, &, !, %, { or [, or that contain : or #, should be quoted.
  • Duplicate keys: a key may appear only once in the same mapping.
  • Mixed list and map: an item cannot be both - item and key: value at the same indentation level.

Need to go the other way? Use the JSON to YAML Converter, or check and pretty-print a file with the YAML Validator.

Frequently asked questions

How do I convert YAML to JSON?

Paste the YAML into the input box. It is parsed and converted to JSON immediately: mappings become objects, sequences become arrays, and scalars become strings, numbers, booleans or null.

Why do I get a 'bad indentation' error?

YAML uses indentation to show structure, so items at the same level must start in the same column, and nested items must be indented further than their parent. Tabs are not allowed for indentation; use spaces.

What happens to YAML comments?

They are removed. JSON has no comment syntax, so comments cannot be carried over.

How are multiple YAML documents converted?

A file with several documents separated by --- lines, such as a set of Kubernetes manifests, becomes a JSON array where each element is one document. A file with a single document becomes a single JSON value.

Are anchors and aliases supported?

Yes. Anchors (&name), aliases (*name) and merge keys (<<: *name) are resolved, so the JSON contains the full, expanded data.

Why did yes or on stay as text?

This converter follows YAML 1.2, where only true and false are booleans. Older YAML 1.1 parsers also read yes, no, on and off as booleans; quote values or use true/false to be safe across tools.

Is my YAML uploaded anywhere?

No. Parsing uses the open-source js-yaml library running locally in your browser, so configuration files and secrets never leave your device.

Are all the tools on FreeToolCabin tested for quality and accuracy?

Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.

Related tools

JSON to YAML ConverterConvert JSON to clean YAML as you type, with indent, quoting and sort options.YAML Validator & FormatterValidate, format and minify YAML, and convert YAML to JSON or back.JSON FormatterBeautify, minify and validate JSON, with a collapsible tree view.JSON to CSVConvert JSON data to CSV for spreadsheets.Docker Compose to KubernetesConvert docker-compose.yml into Kubernetes Deployment, Service, ConfigMap and PVC manifests.Docker Run to Compose ConverterConvert docker run commands to docker-compose.yml, or a compose file back to docker run.JMESPath TesterEvaluate JMESPath expressions against JSON live, the query language used by the AWS CLI.jq PlaygroundRun jq filters on JSON in your browser with live output, flags and an example library.JSON to Excel ConverterTurn JSON into a styled .xlsx spreadsheet; nested arrays become their own linked sheets.CSV to JSONConvert CSV data to JSON with live preview.Excel to CSVConvert XLSX spreadsheets to CSV.CSV ViewerOpen a CSV or TSV file as a sortable, filterable table.Excel Viewer (XLSX / XLS)Open XLSX, XLS and ODS spreadsheets in your browser without Excel.Line Ending ConverterConvert text and files between CRLF, LF and CR line endings.Markdown to HTMLConvert Markdown to clean HTML with a live editor.XML to JSONConvert XML to JSON with validation.Text Encoding ConverterDetect and convert text file encodings like UTF-8, UTF-16 and Latin-1.JSON ViewerExplore JSON as a collapsible tree, search keys and values and copy any node's path.TTF to WOFF2 ConverterConvert TTF and OTF fonts to WOFF2 or WOFF and get a ready @font-face CSS snippet.Chmod CalculatorConvert Linux file permissions between checkboxes, octal (755) and symbolic (rwxr-xr-x) notation.JSON to TypeScriptGenerate TypeScript interfaces or types from JSON, with nested types and optional fields.Morse Code TranslatorTranslate text to Morse code and back, then play it as sound or a blinking light, or save a WAV.HTML Table GeneratorBuild HTML tables in an editable grid with styles, header rows, CSV import and live preview.Hex to Text ConverterConvert hex to text and text to hex with UTF-8 support and space, 0x, \x or comma formats.JSON to XML ConverterConvert JSON to well-formed XML with attributes, arrays and pretty print.HTML to Markdown ConverterTurn HTML or pasted rich text into clean Markdown with tables and live preview.Markdown Table GeneratorBuild Markdown tables in a grid or paste from Excel/CSV, with alignment and preview.JSON ValidatorCheck JSON with the exact line and column of each error, fix tips and one-click auto-fix.Image to Base64Convert images to Base64 data URIs, CSS backgrounds and HTML img tags in your browser.Base64 to ImagePaste a Base64 string or data URI to preview, identify and download the image.JSON CompareCompare two JSON documents and see every added, removed and changed path.Hex to DecimalConvert hex to decimal instantly with steps and signed mode.Decimal to HexConvert decimal to hex instantly with steps and signed mode.Binary to DecimalConvert binary to decimal instantly with steps and signed mode.Decimal to BinaryConvert decimal to binary instantly with steps and signed mode.Two's Complement CalculatorDecimal to two's complement binary and back for 4-64 bits, with invert-and-add-1 steps.XML to CSV ConverterConvert XML to CSV: detects repeating records, flattens nested data, pick your columns.CSV to XML ConverterConvert CSV to well-formed XML with custom root and row names, escaping and pretty print.XSD to XML Sample GeneratorGenerate a sample XML document from an XSD schema, with types, attributes and namespaces.YAML to CSV ConverterTurn a YAML list of objects into CSV with dot-notation columns, custom column order and download.DOCX to Markdown ConverterConvert Word .docx to clean Markdown with headings, lists, tables, links and images in a ZIP.ES6 to ES5 ConverterTranspile modern JavaScript (ES2015+) to ES5 with Babel: targets, module format and loose mode.JavaScript Object to JSONTurn JS object literals and Python dicts into valid JSON: quotes keys, fixes commas and values.JSON Graph VisualizerSee JSON as an interactive node graph with zoom, collapse and search; export PNG or SVG.KML ViewerOpen KML and KMZ files on an interactive map: placemarks, paths, polygons, folders, export.MySQL to PostgreSQL ConverterConvert MySQL dumps and CREATE TABLE statements to PostgreSQL: types, AUTO_INCREMENT, ENUMs, quotes.Text to CSV ConverterTurn space-aligned, fixed-width, pipe or tab separated text into clean CSV with a live preview.VCF File ViewerOpen vCard .vcf files as contact cards with photos, search and duplicate check, export CSV.XML ViewerBrowse XML as a collapsible tree with search, XPath of any node, attributes and big-file support.TOML to JSON ConverterConvert TOML to JSON and JSON to TOML with a full v1.0 parser and clear error lines.JSON to Go StructTurn JSON into Go structs with inferred types, nested structs and json tags.JSON to C# ClassConvert JSON to C# classes or records with System.Text.Json or Newtonsoft attributes.JSON SorterSort JSON keys A-Z recursively, sort arrays by value or by a key, then pretty-print or minify.JSON to HTML TableConvert a JSON array of objects into clean HTML table code with CSS styles and a live preview.CSV to SQL ConverterConvert CSV to SQL CREATE TABLE and INSERT statements for MySQL, PostgreSQL, SQLite or SQL Server.IPv4 to IPv6 ConverterConvert IPv4 to IPv4-mapped, 6to4 and NAT64 IPv6, extract IPv4 from IPv6, and get int/hex/binary.cURL to Code ConverterConvert curl commands to JavaScript fetch, Axios, Python requests, Node.js, PHP and Go code.Code to ImageTurn code into a beautiful syntax-highlighted PNG with themes, window frame and background.Excel to JSON ConverterConvert Excel sheets (XLSX, XLS, ODS) to JSON with header row, type and shape options.CSV to Excel ConverterConvert CSV files to a real .xlsx workbook with typed numbers and dates, one sheet per file.CSV SplitterSplit a large CSV into smaller files by row count, file count or column value, header kept.CSV MergerCombine many CSV files into one, matching columns by name, with dedupe and a source column.VCF to CSV ConverterConvert vCard (.vcf) contacts to CSV for Google or Outlook, or turn a CSV back into a VCF.Calendar Event (.ics) GeneratorCreate an .ics calendar invite with time zone, reminders and repeats + Google/Outlook links.CSV Column ExtractorPick, reorder and rename CSV columns, filter rows by value, and export a new CSV or JSON.CSV Diff CheckerCompare two CSV files by key column and see added, removed and changed rows cell by cell.CSV Duplicate Row RemoverRemove duplicate rows from a CSV by all or selected columns and download the cleaned file.CSV to HTML TableTurn CSV into clean HTML table code with a live preview, styling options and one-click copy.
See all 129 Data & File Format Converters →