Convert any format

Pick an input format and an output format and convert between any pair.

Private by design. Your input never leaves this browser. Conversions run locally on your device.

What this tool handles

  • Any pair of JSON, YAML, TOML, CSV, TSV, XML and HTML tables — 49 combinations from one pair of selectors.
  • CSV and TSV delimiters are detected automatically: comma, semicolon, tab or pipe.
  • A table with no header row is detected and its columns are named column1 to columnN.
  • Values read from CSV, TSV, XML and HTML stay strings until "Infer numbers and booleans" is switched on.
  • A nested value written into a table cell is serialized as JSON text inside that cell.

Example

Input

[{"id":1,"name":"Ada","tags":["math","code"]}]

Output

- id: 1
  name: Ada
  tags:
    - math
    - code

When you would use it

  • A pair that has no page of its own — Six pairings — JSON with YAML, TOML and CSV in both directions — have a dedicated page each. The other forty-three, YAML to XML or TSV to TOML among them, are reachable only from these two selectors.
  • A table copied out of a rendered page — The HTML reader looks for a <table> of <tr> rows with <th> or <td> cells, so a table lifted from documentation or an admin screen can be read straight into JSON or TSV.
  • Reversing the direction you just ran — The swap button exchanges the two selectors and re-runs against the text already in the input box, rather than making you retype it on another page.
  • Validating a file without changing its format — Selecting the same format on both sides parses the document and writes it out again, which reports the syntax error or normalises the indentation of a YAML or TOML file in place.

Common questions

Does pasting a different format switch the input selector?

No. Content that looks like another format raises an offer above the input reading "Read input as …", which you accept or ignore. Nothing is switched and nothing is rewritten for you.

Why does XML gain or lose an outer element?

Reading XML keeps the document element as a wrapping key, so an <order> document becomes {"order": …} and then an [order] table in TOML. Writing XML reverses that: a single top-level key supplies the element name rather than becoming a child of it.

Which options are in play for my pair?

Each control declares the formats it affects and hides itself otherwise — the CSV delimiter appears only when CSV or TSV is on one side, the XML root element only when XML is the output, and key sorting only when YAML is.

What extension does the download get?

The one belonging to the output selector, not the page you started on: picking XML downloads .xml with an application/xml media type.

Related tools

  • JSON → YAML — Convert JSON to readable YAML with configurable indentation.
  • YAML → JSON — Parse YAML and emit pretty-printed JSON.
  • JSON → TOML — Convert a JSON object to TOML.
  • TOML → JSON — Parse TOML configuration into JSON.
  • JSON → CSV — Turn an array of objects into a CSV table.
  • CSV → JSON — Parse CSV or TSV into JSON, with delimiter detection and optional type coercion.

Browse all 25 tools