🔄

JSON CSV Converter

Convert between JSON arrays and CSV, with automatic field detection and quoting
JSON 📂 Text 👤 ToolWorld 🏷️ v1.2.2
Loading...
Input Paste or type text; it is processed locally
Data
Settings Choose how to process
Direction

Everything runs in the browser; your text is never uploaded

Enter text and press process. Everything runs locally; nothing is uploaded

Result Copy the result in one click

How to Use

📖 Tool Introduction


Convert data between JSON arrays and CSV: a JSON array becomes CSV with a header row, and CSV becomes a JSON array.

The two formats earn their place for different reasons. JSON suits programs, since it carries nesting and types, while CSV opens in a spreadsheet and can be handed to someone who has never seen a code editor. Moving a report out of a system, loading data into one, or gluing two services together tends to involve going back and forth between them, and doing that by hand is where mistakes get introduced.

Going to CSV, the header is collected from every field name that appears anywhere in the array, so rows missing some fields still line up under the right column rather than shifting sideways. A single object rather than an array is accepted too and treated as one row, which suits the case where you copied one record out of a response.

Going to JSON, the first line becomes the field names and every following line is assembled into an object against them. Parsing follows the quoting rules: a field wrapped in quotes may contain commas and newlines, and a quote inside a field is written twice. Blank lines are skipped rather than becoming empty records.

The result reports the number of rows and fields, which is the quickest way to see whether the conversion read the data the way you expected. Everything runs in the browser, so what you paste never leaves your device.

A note on encodings, since that is what goes wrong in practice. The CSV produced here is plain UTF-8, which every modern spreadsheet reads correctly, but Excel on Windows has a long history of opening such a file by assuming a local code page and turning Chinese text into nonsense. When that happens the conversion has not lost anything: importing the file through the data menu and choosing UTF-8 explicitly brings it back, and it is worth trying before concluding that the data was damaged.

✨ Key Features


  • JSON array to CSV, with the header collected from every field present
  • CSV to JSON array, using the first line as field names
  • Quoted fields handled properly, including commas and newlines inside them
  • Quotes within a field follow the CSV rule of being doubled
  • Blank lines are skipped instead of producing empty records
  • Runs locally: nothing is uploaded

🚀 How to Use


  1. Paste a JSON array or CSV text on the left
  2. Pick the direction on the right
  3. Press process, or use Ctrl plus Enter
  4. The result box shows the output with row and field counts
  5. Copy result puts it on your clipboard

⚠️ Things to Note


  • Data source: Based on the JSON and CSV format specifications; conversion runs in the browser
  • Nesting is flattened: Objects and arrays nested inside a JSON record become a string in the CSV cell
  • First line is the header: When converting to JSON the first row is read as field names, so headerless data needs one added first
  • Chinese needs no special handling: Chinese content in CSV is preserved and opens correctly in a spreadsheet
  • Privacy: Everything runs in the browser. What you paste is never sent to a server

Related

⏫︎