🔄 JSON Converter

Transform JSON into CSV, XML, YAML, TypeScript, Java POJO, SQL and more.

Paste JSON to begin conversion
0 / 50,000 chars
JSON INPUT

About JSON Converter

JSON is the de-facto standard for data exchange, but most downstream systems — spreadsheets, databases, config files, typed languages — require a different format. This free online JSON converter transforms any valid JSON into 9 widely-used formats instantly, with zero server round-trips. Your data never leaves your browser.

Whether you need to import API data into a spreadsheet as CSV, seed a database with SQL INSERT statements, generate TypeScript interfaces from a sample payload, or produce a Markdown table for documentation, this tool handles it in one click. Each format comes with configurable options — choose your delimiter, indentation, root element name, dialect, and more.

How to convert JSON

  1. Paste your JSON into the input panel. The validator confirms it is valid JSON before enabling the format buttons.
  2. Click a format tab (CSV, XML, YAML, TypeScript, Java, SQL, Markdown, TOML, or PHP) to run the conversion immediately.
  3. Adjust options in the output panel — delimiter, indent size, root element name, SQL dialect, etc. — and the output updates live.
  4. Copy or Download the result using the header buttons. CSV output also has a Table view to preview rows and columns.
  5. Use ↵ Wrap to soft-wrap long lines in formats like XML or YAML without horizontal scrolling.

Supported output formats

📊 CSV

Flattens nested objects with dot-notation column names. Auto-detects inner arrays from wrapped objects like {users:[...]}. Configurable delimiter (comma, semicolon, tab, pipe) and optional header row.

🏷️ XML

Full recursive XML with configurable root and item element names. Proper escaping of &, <, >, and ".

📄 YAML

Clean YAML respecting all data types. Quotes strings that look like numbers. Handles nested objects and arrays. Configurable indent and line-wrap width.

🔷 TypeScript

Generates interface or type alias declarations. Nested objects get their own named interface. Choose between interface and type syntax.

☕ Java POJO

Full class with getters/setters and @JsonProperty annotations. Optional Lombok @Data, @NoArgsConstructor, and @AllArgsConstructor.

🗄️ SQL INSERT

Batched INSERT statements. Flattens nested objects to columns. Choose MySQL, PostgreSQL, or SQLite dialect and batch size.

📋 Markdown

GitHub-flavoured table with aligned columns. Pipe characters in values are automatically escaped.

⚙️ TOML

Sections using [table] and [[array-of-tables]] syntax. Requires a top-level object — wrap bare arrays in a key.

🐘 PHP Array

Nested associative array syntax ready to paste into any PHP file. All types including booleans and null are correctly represented.

Frequently Asked Questions

My JSON is an array, not an object — will CSV conversion work?

Yes. The converter handles both top-level arrays (e.g. [{...},{...}]) and wrapped objects (e.g. {"users":[...]}). For wrapped objects it automatically detects the array inside. Each array element becomes a CSV row, and nested object fields are flattened using dot notation (e.g. address.city).

How does TypeScript interface generation work?

The converter inspects the actual values in your JSON to infer types: strings become string, numbers become number, booleans become boolean, nulls become null, arrays get typed as T[], and nested objects get their own interface with a Pascal-cased name derived from the key. You can choose between interface and type alias output.

Which SQL dialects are supported?

MySQL, PostgreSQL, and SQLite. The main difference is string quoting: MySQL uses backticks for identifiers, PostgreSQL uses double quotes, and SQLite uses double quotes or square brackets. All three produce batched multi-row INSERT statements for efficiency.

Why does YAML output quote some strings?

YAML parsers interpret bare strings like '123', 'true', 'null', 'yes', 'no', and strings starting with special characters (:, {, [, etc.) as non-string types. The converter quotes any string that could be misinterpreted to ensure round-trip fidelity.

What is the difference between Wrap ON and Wrap OFF in the output?

Wrap OFF (default) keeps the output as-is with a horizontal scrollbar for long lines — preserving the exact whitespace. Wrap ON soft-wraps long lines so they fold onto the next line without a scrollbar, making very wide XML or YAML easier to read without scrolling.

JSON converter for developers: CSV, TypeScript, Java, SQL, and XML

JSON rarely stays in JSON format throughout a developer's workflow. Front-end data needs to go into spreadsheets, back-end APIs need matching TypeScript interfaces, Java services need matching DTO classes, and database seed scripts need SQL insert statements. Converting between these formats manually is repetitive and error-prone.

Braxik's JSON converter takes a JSON object or array and transforms it into the format you need. Supported output formats include CSV for spreadsheet tools, TypeScript interfaces for typed front-end code, Java POJOs and records for Spring Boot services, SQL insert statements for local testing, and XML for legacy system integrations.

The converter uses the structure and values of your input JSON to infer types, field names, and relationships. The generated output is a starter scaffold — it captures the shape of your data accurately, but you should always review it before using it in production code, especially for nullable fields, enums, date types, and deeply nested structures.

This tool is particularly useful early in a project when you have a sample API response and need to scaffold matching models across multiple layers of your application. Rather than writing the same field names repeatedly in four different formats, paste the JSON once and get usable starting points for all of them.

How it works

The converter first parses your JSON input into a JavaScript object tree. It then traverses the tree to build a schema, inferring each field's type from its value. Strings become string, numbers become number (or int/double for Java depending on decimal point presence), booleans become boolean, null fields are marked as optional or nullable, and nested objects become nested types or inner classes.

For CSV output, the converter flattens the top-level array of objects into rows. Each unique key across all objects becomes a column header. Nested objects are serialised as JSON strings inside the CSV cell, because CSV cannot express nested structure directly.

For TypeScript and Java output, the converter generates interface or class definitions recursively. Nested objects become separate named interfaces or inner classes. Array fields become typed arrays. The generated names are derived from the JSON key names converted to PascalCase.

Common uses

  • Turn a JSON array returned by a REST endpoint into a CSV for a quick spreadsheet review with stakeholders.
  • Generate a starter TypeScript interface from a sample API response to use as a type in a React or Next.js project.
  • Generate a Java POJO or record class to use as a Spring Boot request or response DTO.
  • Convert a small JSON configuration sample into SQL insert statements for local database seeding.
  • Generate XML for integration with a legacy SOAP or EDI system that does not accept JSON.
  • Scaffold matching models in multiple languages from a single authoritative JSON sample.
  • Quickly create a type-safe shape for data received from a third-party API that does not publish TypeScript types.

Before you rely on the result

  • Use a representative sample with all expected fields present, including optional ones, so the generator can infer a complete schema.
  • Generated types are only as accurate as the sample — a field that happens to be null in your sample will be typed as nullable even if it is always present in production.
  • Review nullable fields manually. A null value in JSON does not tell you whether the field is always null, sometimes null, or never null in real data.
  • For Java output, check that Long is used for large integer IDs rather than int, and that LocalDate or Instant is used for date strings rather than plain String.
  • For CSV output, confirm that nested objects are flattened in the way your target spreadsheet or import tool expects.
  • Check enum fields — a string field with a small set of possible values should usually be an enum, but the converter cannot know this from a single sample.
  • Do not commit generated code without reviewing field visibility, annotations, constructors, and serialisation configuration that your project requires.