How do I convert CSV to JSON or JSON to CSV online?
Paste CSV data to convert it to a JSON array of objects (using the first row as keys), or paste a JSON array to convert it to CSV format. The tool handles quoted fields, commas in values, and various delimiters. Everything runs client-side.
name,age,city Alice,28,NYC Bob,35,London
[
{ "name": "Alice", "age": "28", "city": "NYC" },
{ "name": "Bob", "age": "35", "city": "London" }
]CSV ↔ JSON Converter
Convert between CSV and JSON formats. Handles quoted fields, custom delimiters, and nested commas.
About CSV ↔ JSON Conversion
- Handles quoted fields with commas, newlines, and escaped quotes (
""). - Supports custom delimiters: comma, tab, semicolon, and pipe.
- CSV → JSON uses the first row as object keys (headers).
- JSON → CSV flattens objects into columns — nested objects are stringified.
- Everything runs in your browser — no data is sent over the network.
Tips & Best Practices
Commas inside fields require quoting
The CSV value "San Francisco, CA" must be wrapped in double quotes: "San Francisco, CA". If the value itself contains a double quote, escape it by doubling: "She said ""hello""". Many hand-edited CSV files break on this rule, causing columns to shift right and corrupt the entire row.
CSV has no standard — TSV is often safer
Despite RFC 4180, CSV implementations differ on quoting, escaping, encoding, and line endings. Tab-Separated Values (TSV) avoids most issues because tabs rarely appear in data. Excel, Google Sheets, and most databases support TSV import. Use .tsv extension for clarity.
Flatten nested JSON before converting to CSV
CSV is inherently flat (rows and columns). Nested JSON like {address: {city: "NYC"}} must be flattened to address.city or address_city. Arrays pose a harder problem — you'll need to either join values ("a,b,c") or create one row per array element. Decide your strategy before converting.
CSV injection is a real attack vector
A CSV field starting with =, +, -, or @ is interpreted as a formula in Excel and Google Sheets. An attacker could inject =CMD("calc") into user-generated data. When exporting user input to CSV, prefix these characters with a single quote (') or tab character to prevent formula execution.
Frequently Asked Questions
How do I convert CSV to JSON?
How do I convert JSON to CSV?
What delimiter should I use for CSV files?
Related Convert Tools
SQL to TypeScript/Prisma/Drizzle
Convert SQL CREATE TABLE statements to TypeScript interfaces, Prisma schema, and Drizzle ORM definitions for PostgreSQL, MySQL, and SQLite
ESLint to Biome Converter
Convert your ESLint config to Biome — maps 100+ rules from core, TypeScript, React, JSX-A11y, and import plugins to biome.json
Tailwind to CSS Converter
Convert Tailwind CSS utility classes to standard CSS — supports 500+ classes including spacing, layout, typography, transforms, and arbitrary values
.env to Docker/K8s Converter
Convert .env files to Docker Compose environment blocks, Kubernetes ConfigMaps, Secrets, and docker run flags with sensitive key detection