JSON, YAML and CSV converter
Runs in your browser; nothing is uploaded
Convert between JSON, YAML and CSV in any direction, with a table view of CSV data.
Input · JSON
Output · YAML
Converted YAML appears here as you type.
What JSON, YAML and CSV are for
JSON, YAML and CSV all describe data as text, but for different jobs. JSON is the format of web APIs: strict and easy for programs to parse. YAML holds the same structures as JSON (objects, lists, strings, numbers, booleans) but uses indentation instead of braces, which makes it easier to edit by hand; OpenAPI specs, CI pipelines, Docker Compose and Kubernetes files are usually YAML. CSV is a table: a header row of column names, then one line per record.
The converter reads the input into one data model and writes it out in the target format. Numbers keep the digits they were written with, so a 19-digit ID or 1.50 comes through unchanged. Anything the conversion had to decide (a value YAML reads as a number, a nested object flattened into a column, a key that appears twice) is listed in the notes above the output.
YAML is read with the YAML 1.2 core schema, the current version of the standard. true, false and null are values; yes, no, on and off stay strings, unlike in older YAML 1.1 libraries such as PyYAML. When writing YAML, the converter quotes every string that either version would read as something else, so "yes", "007" and "2024-01-01" read back as the same strings everywhere.
How to use this tool
- 1Choose the formats in From and To in the toolbar. Paste your data into the Input pane, drop a file on it, or press Ctrl+O to open one (up to 5 MB); opening a .yaml, .csv or .json file sets From for you.
- 2Read the result in the Output pane. It updates as you type. When CSV is involved, the Table tab shows the rows and columns.
- 3Adjust the options that appear in the toolbar: the CSV delimiter (or Detect), whether the first row is a header, whether numbers and true/false become JSON values, nesting of dotted column names, and how arrays are written to CSV.
- 4If the input is invalid, the output pane and the status bar give the line and column. Press F8 to put the cursor there.
- 5Swap (Shift+Alt+S) puts the output into the input and flips the formats, so you can check the round trip. Ctrl+Z undoes it.
- 6Copy the output, or download it with Ctrl+S.
Troubleshooting
- Tabs can't be used for indentation in YAML
- YAML only allows spaces for indentation. Replace the leading tabs with spaces; most editors can convert them for you.
- A value can't continue with a
key:line - A line is indented under a key that already has a value on its own line. Either remove the value after the colon, so the indented lines become its children, or fix the indentation.
- Duplicate key
- YAML requires each key in a mapping to be unique. Rename or remove one of them; the error points to the second.
- Row 4 has 5 fields; the header has 4
- A value in that row contains the delimiter without quotes around it, or the header is missing a column. Quote the value ("Pune, MH") or check the delimiter choice.
- Zip codes or IDs lose their leading zeros
- From CSV, values such as
007stay text. From YAML, an unquoted007is the number 7 under the YAML standard, and the notes say so; put it in quotes in the YAML to keep it as text. - Several YAML documents aren't supported
- The input has more than one document separated by
---, as Kubernetes files often do. Convert the documents one at a time.
Frequently asked questions
Which YAML features are supported?
Block mappings and lists, flow collections such as [a, b] and {a: 1}, plain, single- and double-quoted strings over several lines, literal | and folded > block strings with chomping indicators, comments, anchors and aliases, the << merge key and the !!str tag. Complex ? keys, other tags and several documents in one input stop with an error that names the feature, instead of producing wrong data.
How is nested JSON written to CSV?
Each row is one object of the array. Nested objects become columns with dotted names, such as address.city. Arrays are written as JSON text in one cell by default, or spread over numbered columns (tags.0, tags.1) if you choose In columns. The columns are the union of the keys in every row, in the order they first appear. null becomes an empty cell.
What types does CSV to JSON produce?
With Numbers on, a value becomes a JSON number only if it is already written exactly as one (42, -1.5, 1e3), and true and false become booleans. 007, +5 and 1,000 stay text, as do empty cells. Turn Numbers off to keep every value as a string.
Is my data sent to a server?
No. Parsing and conversion run in your browser. To survive a reload, what you paste is kept in this tab's session storage until you clear it or close the tab. Copy link puts the input in the link after #, which browsers never send to a server, but anyone you give the link to can read it. Your settings, such as the formats and delimiter, are saved in this browser.