YAML ⇄ JSON Converter
Convert YAML to JSON and JSON to YAML in your browser. Auto-detects the input, handles multi-document YAML, and reports syntax errors with the line number.
YAML
JSON
How to use
Paste YAML or JSON on the left and the other format appears on the right. In automatic mode the tool tries to read the input as JSON first and falls back to YAML, which works because every JSON document is also valid YAML. Pin the direction with the toggle if you are pasting YAML that happens to look like JSON.
YAML is read with the YAML 1.2 core schema, so bare words like yes, no, on and off stay strings instead of turning into booleans, and octal-looking values such as 0o17 become numbers only when written the 1.2 way. Duplicate keys are rejected rather than silently overwritten. A file with several documents separated by --- becomes a JSON array with one element per document.
When converting JSON to YAML, choose the indentation and whether nested arrays and objects are written one item per line (block style) or inline as [1, 2, 3] (flow style). Strings that a YAML 1.1 parser would misread, such as "yes" or "1", are quoted automatically so the output round-trips in older tools.
Syntax errors show a short headline plus the message from the parser and the line where it gave up. Nothing you paste leaves your browser, so configuration files with credentials or internal hostnames are safe to convert here.
Tools people use next
JSON Formatter
Indent JSON so you can read it, or squeeze it onto one line. Syntax errors are reported with the line they are on.
JSON ↔ CSV Converter
Turn a JSON array into CSV, or a CSV back into JSON. Choose the delimiter and say whether the first row holds column names.
SQL Formatter
Beautify SQL with consistent indentation and keyword casing, or minify it onto one line. Supports MySQL, PostgreSQL, SQLite, SQL Server, BigQuery, Snowflake and Oracle.
Table Converter
Turn a table copied out of a spreadsheet into Markdown, HTML, or CSV. Paste it and all three come out at once.