Skip to main content
ToolSmartly

JSON, CSV, XML and YAML Converter

Pick the input and output formats and paste your data: the conversion runs in your browser, in all twelve directions (CSV to JSON, JSON to XML, YAML to JSON…). Syntax errors are reported with their cause.

Result

How the data is converted

Every conversion goes through an intermediate structure (objects, lists, strings, numbers): the input is parsed, then written out in the output format. Everything happens in the browser, nothing is uploaded.

  • CSV: the first row gives the column names; each row becomes an object. Quoted fields may contain the delimiter, doubled quotes ("") or line breaks. On output, nested objects become dotted columns (address.city) and lists are written as JSON in the cell.
  • XML: attributes become keys prefixed with @, the text of an element that also has attributes or children becomes #text, and repeated elements become a list. The other way round, the same conventions produce attributes and repeated elements; key names that are invalid in XML are fixed (forbidden characters replaced by _).
  • YAML: read and written with the js-yaml library (YAML 1.2). YAML comments are not kept.
  • Types: CSV and XML only contain text. With the option ticked, "42", "3.5", "true" and "false" become numbers and booleans; untick it to keep strings (for example postcodes such as "01000").

To validate or format JSON on its own, use the JSON formatter.

Practical questions about format conversion

Conversion runs in your browser: JSON, CSV, XML and YAML in all twelve directions, with automatic detection of the CSV separator (comma, semicolon or tab).

Frequently asked questions

Why does my CSV from Excel use semicolons?

In countries where the comma is the decimal separator (France, Germany, Spain…), Excel saves CSV files with semicolons. Leave the separator on “Auto-detect” or pick “Semicolon (;)” explicitly.

What does “Recognise numbers and booleans” change?

CSV and XML store everything as text. With the option ticked, 42 becomes the number 42 and true the boolean true in JSON or YAML; untick it to keep values such as postcodes or phone numbers with leading zeros (01234) as text.

How are nested JSON objects turned into CSV?

A CSV is a flat table, so it works best with an array of objects that share the same keys, each object becoming a row. Deeply nested data is better converted to YAML or XML, which keep the structure.