UltraConvert
Converters

CSV ↔ JSON Converter

Convert between CSV and JSON formats for data interchange and processing. CSV to JSON creates arrays of objects using the first row as keys. JSON to CSV generates properly formatted CSV with automatic headers. Full RFC 4180 compliance including quoted fields, embedded commas, newlines within cells, and custom delimiters.

What does this tool do?

The CSV-JSON converter provides bidirectional translation optimized for data processing workflows. CSV to JSON parses CSV data into JavaScript arrays of objects, with the header row becoming object keys. It handles quoted fields, escaped quotes (doubled quotes), embedded commas, and newlines within cells. JSON to CSV converts arrays of objects to CSV format, automatically generating headers from object keys and properly quoting fields that contain special characters. Custom delimiter support (comma, tab, semicolon, pipe) accommodates various regional and application-specific formats.

How it works

For CSV to JSON: the parser reads the first line as headers, then subsequent lines as data rows. RFC 4180 parsing handles quoted fields ("...") that can contain commas and newlines, escaped quotes as """, and trims whitespace based on options. Each row becomes an object with header keys. For JSON to CSV: the tool extracts all unique keys from the array of objects to form the header. Each object is serialized to a row, with values converted to strings and quoted if they contain the delimiter, quotes, or newlines. Papa Parse library provides robust CSV parsing with edge case handling.

Features

How to use

  1. 1

    Select direction

    Choose CSV → JSON to parse tabular data to objects, or JSON → CSV to flatten objects to tabular format.

  2. 2

    Paste input

    Enter CSV data or JSON array. Output updates live as you type for small inputs, or use convert button for larger data.

  3. 3

    Adjust options

    Set delimiter if not comma. Toggle 'Has header' for CSV (off means first row is data, keys become col1, col2...).

  4. 4

    Review and copy

    Verify the conversion looks correct. Copy the result for use in spreadsheets, databases, APIs, or code.

Common use cases

Data import/export

Convert between CSV for spreadsheets/databases and JSON for APIs and JavaScript applications.

API data preparation

Convert CSV datasets to JSON format for POST requests to REST APIs that expect JSON payloads.

Spreadsheet integration

Convert JSON API responses to CSV for analysis in Excel, Google Sheets, or data visualization tools.

Database operations

Prepare CSV data for database imports, or convert query results to JSON for application consumption.

Tips & best practices

Frequently asked questions

Are nested JSON objects flattened?
Nested objects and arrays are JSON-stringified into single CSV cells. CSV doesn't have a native nested structure. For true flattening, use a specialized flattening tool first.
What if my CSV has no header?
Toggle 'Has header' off. With it off, JSON output uses positional keys (col1, col2, col3...). With it on (default), the first row becomes object keys.
Why are some fields quoted and others not?
RFC 4180 only requires quoting when a field contains the delimiter, quotes, or newlines. Optional quoting of all fields is allowed but not required.
Can I convert Excel files?
This tool handles CSV format only. Save Excel files as CSV first (File → Save As → CSV), then use this converter.

Related tools