JSON Converter

Convert JSON to and from CSV, YAML and XML, and generate TypeScript interfaces, Go structs and SQL statements from any JSON document.

Convert JSON to any format, instantly

The JSON converter supports six output formats and three import formats, all processed locally in your browser so your data stays private.

JSON → CSV

Convert a JSON array of objects to a CSV spreadsheet. Column headers are derived from the object keys. Nested objects and arrays are serialised as JSON strings to preserve all data. You can also import a CSV file and convert it back to a JSON array.

JSON → YAML

Generate clean YAML from any JSON document. YAML is the configuration format used by Kubernetes, GitHub Actions, Docker Compose and many other tools. The output follows YAML 1.2 conventions with correct quoting and block style for multiline strings.

JSON → XML

Convert JSON to well-formed XML. Object keys become element names, arrays become repeated sibling elements and primitive values become text content. Useful when integrating with legacy systems or SOAP APIs that require XML input.

JSON → TypeScript

Generate TypeScript interfaces from a sample JSON document. The converter infers types for every field — string, number, boolean, null, arrays and nested interfaces. Optional fields are marked with ?. Ideal for quickly scaffolding types for API responses.

JSON → Go struct

Generate idiomatic Go structs with correct field names, types and json: struct tags. Nested objects become embedded structs. This eliminates the tedious manual work of transcribing API response shapes into Go code.

JSON → SQL

Generate a CREATE TABLE statement and INSERT INTO statements from a JSON array. Column types are inferred from the data. The output is standard ANSI SQL compatible with PostgreSQL, MySQL and SQLite.

Frequently asked questions

Which formats can I convert between?+

JSON to and from CSV, YAML and XML, plus JSON to TypeScript interfaces, Go structs and SQL CREATE/INSERT statements.

Is the conversion accurate for nested data?+

Nested objects and arrays are preserved. For CSV, nested values are serialized as JSON strings so no information is lost.

Does it preserve nested objects in CSV?+

Yes, but with a caveat: CSV is a flat format, so nested objects and arrays are serialized as JSON strings within the cell. This preserves all data while remaining valid CSV. When you import the CSV back you can parse those cells individually.

Can I convert CSV back to JSON?+

Yes. Paste a CSV document (with a header row) and the tool will parse it into a JSON array of objects, one per row. Column names become the object keys.

What TypeScript types does it generate?+

The converter inspects the shape of your JSON and generates TypeScript interfaces with accurate types for each field — string, number, boolean, null, arrays and nested interfaces. Optional fields (those absent in some samples) are marked with ?.

What SQL dialect does it use?+

The SQL output uses standard ANSI SQL syntax for CREATE TABLE and INSERT INTO statements, which is compatible with PostgreSQL, MySQL, SQLite and most other relational databases. Column types are inferred from the JSON value types.

JSON Converter — CSV, YAML, XML & TypeScript | JSON Toolkit