Skip to main content

Free JSON to CSV Converter

Convert JSON arrays to CSV and CSV back to JSON. Handles nested values, quoted fields, and commas in values automatically.

Works offline once loaded
JSON input (array of objects)
CSV output
Output will appear here…

Common uses

  • Export JSON API Data to CSVConvert JSON API responses and data exports into CSV format for Excel, Google Sheets, and databases.
  • Convert JSON to Excel-ready CSVTurn any JSON data file or API response into a flat CSV that Excel and Google Sheets can open directly.
  • Prepare JSON Data for Database ImportConvert JSON exports to CSV for bulk import into MySQL, PostgreSQL, SQLite, and other databases.
  • Convert JSON Reports to CSV for AnalysisTransform JSON analytics data, reports, and logs into CSV for business intelligence and data analysis.
  • JSON to CSV for Developer WorkflowsQuickly convert test fixtures, mock data, and config JSON to CSV or back β€” part of your data pipeline.

How It Works

This tool converts between JSON and CSV entirely in your browser using zero external libraries β€” the conversion logic is hand-written TypeScript that runs locally. JSON parsing uses the browser's native JSON.parse, while CSV parsing uses a custom RFC 4180 state-machine that handles the edge cases most naive converters get wrong.

  1. 1
    JSON parsed and headers collected
    JSON.parse() reads the input and validates it as an array. The converter then walks every object in the array to build a union of all keys β€” so sparse arrays where different rows have different fields still produce a complete header row.
  2. 2
    Optional nested-object flattening
    If the flatten option is on, nested objects like {"address":{"city":"Oslo"}} are recursively collapsed into dot-notation columns (address.city) before headers are built. Arrays and empty objects are left as JSON-stringified cell values.
  3. 3
    RFC 4180-compliant cell encoding with formula neutralization
    Each cell value is escaped per RFC 4180: fields containing commas, double-quotes, or newlines are wrapped in double-quotes, and internal quotes are doubled. Safe Export mode (on by default) also prefixes any cell starting with =, +, -, or @ with a single quote, preventing spreadsheet apps like Excel or Google Sheets from treating injected values as executable formulas.
  4. 4
    CSV-to-JSON uses a character-level state machine
    Reversing direction, the shared parseCsv function walks the input character-by-character, tracking whether it is inside a quoted field to correctly handle embedded commas, escaped double-quotes (""), and newlines inside cells β€” cases that a simple line-split approach mishandles. detectDelimiter sniffs the first row for comma, semicolon, tab, or pipe to support non-standard exports automatically.

Related Tools

Frequently Asked Questions