Home › Developer Tools › JSON to YAML Converter

JSON to YAML Converter

Paste JSON and readable YAML appears instantly. Pick the indentation, quote style and line width, sort keys if you like, then copy the result or download it as a .yaml file. Your data never leaves your browser.

Last updated:

YAML output

      
Converts automatically as you type.
Advertisement
Advertisement

How to use the JSON to YAML Converter

  1. Paste your JSON into the left box, upload a .json file, or click Sample.
  2. Check the status bar. If the JSON has a mistake, the line is highlighted with the reason; click Go to error to jump there.
  3. Choose the YAML style: indentation, quote style, line width and whether keys are sorted.
  4. Need several documents? Tick Array items as separate documents to write each item of a top-level array after a --- line, as Kubernetes manifests do.
  5. Copy or download the YAML.

JSON vs YAML: the same data, two notations

DataJSONYAML
Object{"name": "web", "port": 80}name: web
port: 80
Array["a", "b"]- a
- b
Nested object{"db": {"host": "localhost"}}db:
  host: localhost
Empty values{}, [], null{}, [], null
String that looks like another type"true", "30"'true', '30' (quoted so it stays a string)
Multi-line string"Line one\nLine two"|- block with each line indented

Why convert JSON to YAML?

YAML is the usual format for configuration: Kubernetes manifests, Docker Compose files, GitHub Actions and GitLab CI workflows, Ansible playbooks and many app settings files. It needs no braces, brackets or commas, and it allows comments, so people find it easier to read and edit. JSON is better for APIs and machine-to-machine data. Converting lets you take an API response, a JSON schema example or a kubectl get -o json output and turn it into a config file you can maintain.

Because YAML uses indentation for structure, always use spaces, never tabs, and keep the indentation consistent. After editing the result by hand, paste it into the YAML Validator to check it, or convert it back with the YAML to JSON Converter.

Frequently asked questions

How do I convert JSON to YAML?

Paste the JSON into the input box. It is parsed and written out as YAML immediately: objects become key: value lines, arrays become lists with a dash before each item, and nesting is shown with indentation instead of braces and brackets.

Is every JSON file valid YAML?

Almost. YAML 1.2 was designed as a superset of JSON, so most JSON documents are already valid YAML. Converting to YAML's block style simply makes them much easier to read and edit.

Why are some strings quoted in the YAML?

Strings that would otherwise be read as another type, such as "true", "null", "123" or "yes", or that contain characters like : or # in risky places, are quoted so the YAML loads back to exactly the same data. Plain words stay unquoted.

Does the converter keep the order of keys?

Yes. Keys keep the order they have in your JSON unless you tick Sort keys, which sorts them alphabetically at every level.

What happens to very large numbers?

JSON numbers are read as JavaScript numbers, which are exact only up to 9,007,199,254,740,991. Longer integers, such as some IDs, would be rounded, so the tool warns you. Put such values in quotes in the JSON to keep them exactly.

Which library does the conversion?

It uses js-yaml, a widely used open-source YAML parser and writer for JavaScript. It runs locally in your browser, so nothing is uploaded.

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

YAML to JSON ConverterConvert YAML to pretty or minified JSON, with errors pinned to the exact line.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 XML ConverterConvert JSON to well-formed XML with attributes, arrays and pretty print.YAML to XML ConverterConvert YAML to pretty, well-formed XML with custom root, attributes and array item tags.JSON to Excel ConverterTurn JSON into a styled .xlsx spreadsheet; nested arrays become their own linked sheets.JSON to CSVConvert JSON data to CSV for spreadsheets.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.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.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 Python ClassGenerate Python dataclasses, Pydantic models or TypedDicts with type hints from JSON.SQL to JSON ConverterConvert SQL INSERT statements and dumps into a JSON array of row objects, with CSV export.TSV to CSV ConverterConvert TSV to CSV and back, or between tab, comma, semicolon and pipe, with correct quoting.TypeScript to JavaScriptConvert TypeScript or TSX to clean JavaScript instantly: strip types, keep or compile JSX.XML to YAML ConverterConvert XML to clean YAML with attributes, text nodes, lists and exact error lines.Boolean Algebra SimplifierSimplify boolean expressions or minterm lists to minimal SOP and POS with Quine-McCluskey steps.Compare Excel FilesCompare two Excel spreadsheets cell by cell, highlight changes and export a diff report.CSV CleanerClean messy CSV in one click: trim spaces, drop empty rows and columns, fix headers, dedupe.CSV VLOOKUP ToolJoin two CSV or Excel files on a key column like VLOOKUP, with left, inner and full joins.Remove Duplicates in ExcelFind and remove or highlight duplicate rows in XLSX or CSV files by the columns you choose.GeoJSON ViewerView GeoJSON on a map, inspect and edit properties, validate against RFC 7946 and export.GPX ViewerOpen GPX tracks on a map with distance, elevation profile, moving time, speed and splits.JSON Repair ToolFix broken JSON automatically: trailing commas, quotes, comments, truncated data, with a diff.Karnaugh Map SolverSolve 2–6 variable K-maps: click cells or enter minterms to get the minimal SOP or POS with groups.Merge Excel FilesCombine XLSX, XLS and CSV files into one workbook or append all rows into a single sheet.Parquet File ViewerOpen Apache Parquet files in your browser: schema, rows, filters and CSV or JSON export.Query CSV with SQLRun SQL on CSV, Excel, JSON and Parquet files in your browser with DuckDB. Join and export.Online Serial MonitorTalk to Arduino, ESP32 and USB serial devices in your browser: log, send, plot and save.Split Excel FileSplit an Excel sheet into several files by row count or by each value in a column, as ZIP.SQL Create Table GeneratorDefine columns, keys, defaults and indexes; get CREATE TABLE SQL for MySQL, Postgres and more.SQL IN Clause GeneratorTurn a pasted list into a SQL IN ('a','b') clause with quoting, dedupe and 1,000-item chunks.SQL Online CompilerRun SQL queries online on SQLite with sample databases, a result grid, CSV export and .db save.SQL to ER DiagramPaste CREATE TABLE statements and get an entity-relationship diagram with keys and links.XML to XSD GeneratorGenerate an XML Schema (XSD) from sample XML: types, occurrences, attributes and namespaces.XML ValidatorCheck if XML is well-formed, see the exact line and column of each error and pretty-print it.Wildcard Mask CalculatorConvert a subnet mask or CIDR to a wildcard mask for ACLs and OSPF, with range and binary.CSV to VCF ConverterConvert a contacts CSV into a vCard (.vcf) file, mapping columns to name, phone, email and more.CSV to YAML ConverterConvert CSV rows to a YAML list of mappings with type inference and delimiter detection.Endianness ConverterSwap byte order of 16, 32 and 64-bit hex values and see big- and little-endian integers and floats.Excel to SQL ConverterTurn an Excel sheet into CREATE TABLE and INSERT statements for MySQL, PostgreSQL, SQLite or SQL Server.Excel to VCF ConverterTurn an Excel contact list into a vCard .vcf file for iPhone, Android, Google or Outlook.
See all 129 Data & File Format Converters →