CSV ↔ JSON Converter
Convert CSV to JSON (array of objects) or JSON to CSV — quoted-field aware, header-row optional, runs in your browser.
このツールを使う理由
05Free in-browser CSV ↔ JSON converter. Switch direction with a toggle. CSV → JSON treats the first row as keys by default and emits a JSON array of objects. JSON → CSV accepts an array of objects, infers columns from all keys present, and quotes any value containing a comma, quote, or newline. No upload.
Pick a direction with the toggle and paste your input. The conversion runs live as you type — no submit button, no server round-trip.
CSV → JSON parses RFC 4180-style CSV: comma-separated fields, quoted fields (with "" as an embedded quote escape), and both LF and CRLF line endings. With "First row is the header" set to Yes (default), the parser uses row 1 as object keys and emits a JSON array of objects. Set to No to get a JSON array of arrays instead — useful when there's no header row or when you want raw positional data.
JSON → CSV accepts an array of objects (the format CSV → JSON produces). The converter walks every object to collect the full set of keys, uses that as the header row, and emits one CSV row per object. Values containing commas, quotes, or newlines are auto-quoted with "" escaping. Non-string values (numbers, booleans, null, nested objects) are JSON-stringified into the cell.
Everything runs in your browser. CSV exports from databases or SaaS dashboards often contain sensitive data — paste them freely; nothing is uploaded. Pair with our JSON Formatter to pretty-print or validate the JSON side, or with Table Format Converter for Markdown/HTML table output.
使い方
03コピー前のクイックチェック
03Confirm the input is the format you intended.
Scan the result before using it in a document, URL, config, or message.
Copy only the output you need.
ユースケース
Export a Google Sheets / Excel sheet as CSV, paste it in, and copy the JSON array of objects to send as a request body or seed a development database.
Application logs sometimes ship as CSV. Convert to JSON to inspect specific rows with a JSON viewer's structure, search, and filtering — much easier than reading raw rows.
Some non-developer stakeholders prefer CSV/Excel over JSON. Take the JSON response from your API, paste it in, and hand back a CSV they can open in Excel.
When moving data between systems (DB to DB, SaaS to SaaS), you often need to translate between row-oriented CSV exports and document-oriented JSON imports. This tool handles the round-trip quickly without writing a script.
When mocking up data for a prototype or test, it's faster to type in CSV (or paste from a spreadsheet) than to write JSON by hand. Convert when you're done and use the JSON as a fixture.
ヒントとコツ
- 01Quoting and the comma trap
If your CSV has cells that contain commas (a price like "1,200" or a sentence), those cells must be wrapped in double quotes. Embedded quotes inside a quoted cell use <code>""</code> as the escape. The parser handles both — but if your source data uses single quotes or escaped backslashes instead, those won't decode correctly.
- 02JSON → CSV uses union of all keys
If your JSON array has objects with different shapes, the CSV header includes every key seen anywhere. Missing keys produce empty cells in their column. This is usually what you want — but it can produce surprisingly wide CSVs if your JSON is sparse.
- 03Non-string JSON values get JSON-encoded into cells
Numbers and booleans serialize naturally (e.g., <code>42</code>, <code>true</code>). Nested objects and arrays are JSON-stringified into the cell value (e.g., <code>{"x":1}</code>) so the CSV remains lossless for round-trip. Excel will display the nested JSON as a string.
- 04Round-trip safety
CSV → JSON → CSV is lossless for flat object arrays with simple types. It's NOT lossless if your source has nested objects (they become JSON-encoded strings in the CSV and would re-parse as strings, not objects) or if your CSV uses non-RFC quoting conventions.
よくある質問
07
Does the converter run entirely in my browser?
Yes. Both directions use pure JavaScript — JSON.parse / JSON.stringify for the JSON side, and a small custom RFC 4180-style CSV parser for the CSV side. Nothing about the input or the output touches a server. Safe for sensitive data exports.
What CSV format does the parser handle?
Comma-separated values with optional double-quoted fields and <code>""</code> as the embedded-quote escape (the RFC 4180 / Excel convention). Both LF and CRLF line endings work. Tab-separated (TSV) and other delimiters are not supported in this tool — paste TSV into a spreadsheet first to re-export as CSV, or use a search-and-replace step.
What does "First row is the header" do?
When Yes (default), CSV → JSON treats row 1 as object keys: <code>name,age</code> produces objects like <code>{name: ..., age: ...}</code>. When No, it emits a JSON array of arrays (positional, no keys). Pick No if your CSV has no header or you want raw rows for downstream column processing.
How does JSON → CSV decide what columns to include?
The converter walks every object in the array and collects the union of all keys. Each object then produces one CSV row, filling its known keys and leaving missing-key cells empty. If your JSON has heterogeneous objects, the output is wide; if all objects share the same shape, the output is clean.
Can the tool handle nested JSON objects in CSV cells?
Nested objects and arrays inside the JSON are JSON-stringified into the CSV cell value (so they appear as <code>{...}</code> text). The CSV side stays flat — true hierarchical export would need a different format (e.g., JSON Lines or a nested CSV convention). For most reporting and API-handoff use cases, the flat output is what you want.
What's the maximum input size?
No hard limit — performance depends on your browser and device. Hundreds of kilobytes of either direction is fast; multi-megabyte inputs may take a few seconds and use noticeable memory. For multi-hundred-megabyte CSV/JSON, use a command-line tool like <code>jq</code>, <code>csvkit</code>, or <code>miller</code>.
Why is my JSON-to-CSV erroring with "expects an array (of objects)"?
JSON → CSV requires the top-level JSON value to be an array of objects (the format CSV → JSON produces). If your input is a single object, wrap it in <code>[ ... ]</code>. If it's an array of arrays or array of primitives, restructure to objects first — or convert directly via spreadsheet software which handles those shapes.
関連ツール
03JSONフォーマッター→
JSONのフォーマット、ミニファイ、バリデーションを一画面で行えます。
JSON to TypeScript Types→
Generate TypeScript interface declarations from a JSON sample — nested types, arrays, optional keys inferred.
テーブル形式変換ツール→
CSV・JSON・Markdownテーブル間でデータをブラウザ上で変換します。