Turn an API sample into configuration
Convert a JSON sample into YAML to drop into a configuration file or documentation.
Guide
The data format converter works between JSON, YAML, XML and CSV by first “parsing into a JavaScript value” and then serialising to the target format. It is not simple text substitution, so a syntax error in the source data fails clearly, and converting across formats performs the structural normalisation that is unavoidable.
Updated 2026-09-102 min read
.json, .yaml, .yml, .xml or .csv file handed over inside the site.| Input | Output | Notes |
|---|---|---|
| An array of JSON objects | A CSV table | The object keys become the header |
| A CSV header row plus data | A JSON array | Papa Parse with dynamic typing on |
| A JSON array → XML | <root><item>… |
An array is wrapped in root and item |
JSON.parse, so comments, trailing commas and unquoted keys — anything that is not standard JSON — fail.js-yaml; XML is validated first with fast-xml-parser, whose errors carry a line and column, and attributes are then kept with an @_ prefix while text values are trimmed.trim()ed before parsing, so leading and trailing blank lines are not preserved.JSON.stringifyed inside the cell rather than spread across columns.<root> automatically, and array elements use <item>, so a round trip across formats cannot guarantee that the original structure names survive.Convert a JSON sample into YAML to drop into a configuration file or documentation.
Convert a CSV with a header row into an array of objects for a script or an API test.
CSV is a two-dimensional table, so the tool stringifies nested values as JSON instead of recursively flattening them into columns.
The parser keeps attributes and represents them with an @_ prefix, and the same prefix is recognised when converting back to XML.
Parsing and format conversion both happen locally in the browser; a file is read as text only and is never sent to a server.
Updated 2026-09-10
Convert between JSON, YAML, XML and CSV in every direction