CSV → JSON変換器

CSVテキストをきれいなJSONへすばやく変換します。

// about

ツールについて

Excel 등의 表形式データ(CSV)를 JSONフォーマットへ相互変換します。ウェブアプリとスプレッドシート間でデータを移行する際に役立ちます。

使い方

  1. 変換したいCSVテキストを入力ボックスに貼り付けます。
  2. 区切り文字(通常はカンマ)を確認します。
  3. 「変換」を押して出力されたJSONをコピーします。

このツールが使われる理由

  • Excelの表データとウェブプログラム間の連携がスムーズになります。
  • カンマ区切りやセミコロン区切りに柔軟に対応します。
  • 特別なソフトをインストールせずにブラウザで完結します。

よくある質問 (FAQ)

CSVファイルとは何ですか?

項目がカンマ(,)で区切られたシンプルなテキスト形式の表データです。

1行目にヘッダー(列名)は必要ですか?

1行目に列名があると、JSONのキー名として綺麗に割り当てられます。

区切り文字には何を入力すればいいですか?

基本はカンマ(,)ですが、地域によってはセミコロン(;)が使われる場合もあります。

ガイド · データ · 4分で読めます

CSVとJSONの違い:使い分けと変換時の注意点

表計算ソフトの書き出しをAPIに送ったり、APIのレスポンスをExcelで開いたりするには、CSVとJSONの変換が必要です。形式の違いを知っておけば、途中でデータが壊れるのを防げます。

CSV(Comma-Separated Values)は表です。1行目に列名があり、続く各行がレコードで、値はカンマで区切られます。どの行も同じ列を持つ平らなデータを保存する、最も単純で軽い方法です。

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

[
  {"name": "Kim", "city": "Seoul", "score": 92},
  {"name": "Lee", "city": "Busan", "score": 85}
]
CSVとJSONの構造の違い、ExcelでUTF-8のCSVが文字化けする理由、カンマや引用符のエスケープ規則、入れ子のデータを平らにする方法を解説します。
ガイドを読む →
AIで作る

このツールをAIで自作してみましょう

自分用のバージョンが必要なら、作業指示プロンプトをAIチャットに貼り付けるか、スキルファイルをAIコーディングエージェントに保存してください。私たちが開発時に整理した機能、例外、テストケースが含まれています。

プロンプトとスキルは英語で提供しています。AIツールはどの言語でもよく理解できます。

AI作業指示プロンプト

Claude、ChatGPT、GeminiなどのAIチャットにそのまま貼り付けてください。

You are an experienced full-stack web developer. Build a web tool called "CSV → JSON変換器" 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.md)

Claude CodeなどのAIコーディングエージェントで .claude/skills/build-csv-json-converter/SKILL.md に保存すると、このツールを作る・直すたびに再利用できます。

---
name: build-csv-json-converter
description: Use when building or changing a CSV → JSON変換器 tool. Build a converter between CSV and JSON.
---

# Build: CSV → JSON変換器

## 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

AIに任せるときのコツ

  • 最初の行に使用技術(React、Vue、素のHTMLなど)を書くと、プロジェクトに合ったコードになります。
  • コードを受け取る前に、テストケースを実行して結果を見せるよう依頼しましょう。
  • 本物のパスワード、顧客データ、APIキーは入力せず、サンプル値を使ってください。