📊 JSON to CSV Converter

📊
Characters: {{ jsonInput.length }}
⚙️
🔧
⚡
{{ result.isValid ?'✅' :'❌' }}
{{ result.isValid ?'JSON successfully converted to CSV' :'JSON contains errors' }}
🚨
{{ error }}
⚠️
{{ warning }}
📤
{{ result.csv }}
Characters: {{ result.stats.csvSize }}
📊
CSV Rows:
{{ result.stats.rows }}
CSV Columns:
{{ result.stats.columns }}
JSON Arrays:
{{ result.stats.arrayItems }}
JSON Objects:
{{ result.stats.objectItems }}
CSV Headers:
{{ result.stats.headers.slice(0, 5).join(',') }}... ({{ result.stats.headers.length - 5 }} more)
💾
Original JSON: {{ result.stats.originalSize }} chars (~{{ Math.round(result.stats.originalSize / 1024 * 100) / 100 }} KB)
CSV Output: {{ result.stats.csvSize }} chars (~{{ Math.round(result.stats.csvSize / 1024 * 100) / 100 }} KB)
{{ result.stats.csvSize > result.stats.originalSize ?'Increase:' :'Decrease:' }} {{ Math.abs(result.stats.originalSize - result.stats.csvSize) }} chars
💾
⚠️ {{ error }}

ℹ️ About JSON to CSV Converter

JSON to CSV conversion turns structured API responses, logs, exports, and configuration data into rows that can be opened in spreadsheets, imported into databases, or passed to reporting tools. JSON is the data interchange format defined by RFC 8259, while CSV is commonly based on the text/csv format described in RFC 4180.

Use this converter when an API returns JSON but the next step needs a table: product feeds, analytics events, vulnerability scan findings, inventory lists, contact records, or test fixtures. Arrays of objects become one CSV row per object, a single object becomes one row, and simple arrays are converted to index and value columns.

Conversion options:

  • Headers: include a header row built from the JSON object keys, using the first-seen column order.
  • Delimiters: output comma, semicolon, tab, or pipe-delimited text for different import targets.
  • Nested objects: flatten object paths with dot notation such as user.address.city, or keep nested values as JSON strings.
  • Quoting: quote fields that contain delimiters, quote characters, carriage returns, or line breaks.
  • Value formatting: choose boolean labels and the replacement text for null or missing values.

Example:

[
  {
    "id": 101,
    "name": "Ada",
    "active": true,
    "team": {
      "name": "Research"
    }
  },
  {
    "id": 102,
    "name": "Linus",
    "active": false,
    "team": {
      "name": "Platform"
    }
  }
]

With headers enabled and nested objects flattened, the CSV output is:

id,name,active,team.name
101,Ada,true,Research
102,Linus,false,Platform

Practical limitations:

  • CSV has no native arrays, objects, schema, or datatypes; nested arrays and complex values are emitted as JSON text in a cell.
  • Rows with different object keys produce blank cells where a row does not contain a discovered column.
  • Column order follows key discovery order from the input, so normalize JSON first when import templates require a fixed order.
  • Large pasted datasets may be easier to process with a streaming ETL tool or database import pipeline.
  • The page converter runs in your browser; data sent to the public API endpoint is processed server-side.

For richer table metadata, datatypes, foreign keys, and validation rules beyond plain CSV, see the W3C Model for Tabular Data and Metadata on the Web.

API Usage Example:

POST /api/tools/webdev/json-to-csv
Content-Type: application/json

{
    "json": "[{\"name\":\"John Doe\",\"age\":30,\"city\":\"New York\"},{\"name\":\"Jane Smith\",\"age\":25,\"city\":\"San Francisco\"}]",
    "delimiter": ",",
    "enclosure": "\"",
    "escape": "\\",
    "includeHeaders": true,
    "flattenObjects": false,
    "booleanFormat": "true/false",
    "nullValue": ""
}
Ready