CSV to JSON Converter

Transform CSV text into pretty JSON instantly.

// about

About this Tool

Converts spreadsheet CSV files into JSON format, or turns JSON data back into a CSV file. Perfect for moving data between Excel sheets and web apps.

How to use it

  1. Paste your CSV text or JSON code.
  2. Select conversion direction (CSV to JSON or JSON to CSV).
  3. Click 'Run' and copy or save the converted output.

Why people use this tool

  • Easily switch data between Excel tables and modern web apps.
  • Supports custom column dividers like commas or semicolons.
  • Fast instant conversion without installing Excel or plugins.

Frequently Asked Questions

What is a CSV file?

CSV stands for Comma-Separated Values, a simple text table used by Excel and spreadsheets.

Does my CSV need a header row?

Having column titles in the first row helps create clean field names in JSON.

What delimiter should I select?

Most files use standard commas (,), but some regional files use semicolons (;).

Guides · Data · 7 min read

CSV vs JSON: When to Use Each and What to Watch When Converting

Sending a spreadsheet export to an API, or opening an API response in Excel, means converting between CSV and JSON. Knowing how the formats differ prevents data from being damaged along the way.

CSV (Comma-Separated Values) is a table. The first line holds column names and each following line is a row, with values separated by commas. It is the simplest, lightest way to store flat data in which every row has the same columns.

name,city,score
Kim,Seoul,92
Lee,Busan,85

[
  {"name": "Kim", "city": "Seoul", "score": 92},
  {"name": "Lee", "city": "Busan", "score": 85}
]
Structural differences between CSV and JSON, why Excel garbles UTF-8 CSV files, quoting rules for commas and quotes, and how to flatten nested data.
Read guide →
Build it with AI

Build this tool yourself with AI

Want your own version of this tool? Copy the work-order prompt into an AI chat, or save the skill file for an AI coding agent. Both describe the features, edge cases and test cases we used when building it.

AI work-order prompt

Paste it as-is into an AI chat such as Claude, ChatGPT or Gemini.

You are an experienced full-stack web developer. Build a web tool called "CSV to JSON Converter" that meets the requirements below.

## Goal

Build a converter between CSV and JSON.

## Core features

- CSV → JSON (array of objects) and JSON → CSV
- Auto-detect comma, semicolon or tab delimiters
- Header row on/off
- Optional conversion of numbers and booleans
- Download CSV with a UTF-8 BOM for Excel

## Inputs

- CSV or JSON text/file
- Delimiter, header and type options

## Outputs

- Converted data
- Row and column counts

## Edge cases and handling rules

- Follow RFC 4180 for quoted commas, line breaks and doubled quotes
- Keep values with leading zeros (postal codes) as strings
- Flatten nested JSON into dotted columns (user.name)
- Warn when rows have different column counts

## Implementation requirements

- Build it as a single page (HTML, CSS, JavaScript) that runs entirely in the browser, and never send the user's input to a server.
- Make the UI responsive and easy to use on mobile; label every input and keep everything keyboard accessible.
- Add a Copy button for results and show clear, friendly error messages for invalid input.
- Keep the core logic in functions separate from the UI so it can be unit-tested.

## Definition of done (test cases)

- '"Seoul, Korea"' stays a single value
- '01234' is not turned into a number
- Round-tripping keeps the same row count

First outline your implementation plan in at most five lines, then write the complete code, and finally explain how to check the test cases above.

Skill (SKILL.md)

Save it as .claude/skills/build-csv-json-converter/SKILL.md for AI coding agents such as Claude Code to reuse whenever you build or change this tool.

---
name: build-csv-json-converter
description: Use when building or changing a CSV to JSON Converter tool. Build a converter between CSV and JSON.
---

# Build: CSV to JSON Converter

## Goal

Build a converter between CSV and JSON.

## Workflow

1. Review the required features, inputs and outputs below and ask about anything missing first.
2. Implement the core logic as pure functions separate from the UI.
3. Check the logic against the test cases in the verification list.
4. Build a responsive UI with an input form, a result area and a Copy button.
5. Reproduce each edge case listed under Rules and refine the error messages.

## Core features

- CSV → JSON (array of objects) and JSON → CSV
- Auto-detect comma, semicolon or tab delimiters
- Header row on/off
- Optional conversion of numbers and booleans
- Download CSV with a UTF-8 BOM for Excel

## Inputs

- CSV or JSON text/file
- Delimiter, header and type options

## Outputs

- Converted data
- Row and column counts

## Rules

- Follow RFC 4180 for quoted commas, line breaks and doubled quotes
- Keep values with leading zeros (postal codes) as strings
- Flatten nested JSON into dotted columns (user.name)
- Warn when rows have different column counts
- Build it as a single page (HTML, CSS, JavaScript) that runs entirely in the browser, and never send the user's input to a server.

## Verification

- [ ] '"Seoul, Korea"' stays a single value
- [ ] '01234' is not turned into a number
- [ ] Round-tripping keeps the same row count

Tips for working with AI

  • Tell the AI your stack (for example React, Vue or plain HTML) on the first line so the code matches your project.
  • Ask it to run the listed test cases and show the results before you accept the code.
  • Never paste real secrets, customer data or API keys into the prompt; use sample values instead.