CSV ↔ JSON 변환기
CSV 데이터를 JSON으로, JSON 배열을 CSV로 변환하세요 — 구분자 옵션과 라이브 미리보기 포함.
이 도구에 대해
양방향 CSV 및 JSON 변환기. CSV를 붙여넣어 객체의 JSON 배열을 얻거나(첫 번째 행을 키로 사용), JSON 배열을 붙여넣어 CSV로 내보내세요. 사용자 지정 구분자(쉼표, 세미콜론, 탭)를 지원하고 따옴표로 묶인 필드를 올바르게 처리합니다.
사용 방법
- 1 헤더 행이 있는 CSV 데이터를 입력에 붙여넣고 'CSV → JSON'을 클릭하세요.
- 2 또는 객체의 JSON 배열을 붙여넣고 'JSON → CSV'를 클릭하세요.
- 3 CSV가 세미콜론이나 탭을 사용하는 경우 구분자를 선택하세요.
- 4 '복사' 버튼으로 결과를 복사하세요.
What CSV and JSON each get right
CSV (comma-separated values) and JSON (JavaScript Object Notation) are the two formats most data passes through on its way between a spreadsheet and a program. CSV is a flat grid: one header row names the columns, and every line below it is a record whose fields line up in the same order. It is compact and opens in Excel, Google Sheets, or any text editor. JSON, by contrast, is a tree of objects and arrays — it labels every value with a key, so a program can read a field by name instead of counting columns. This converter moves your data both directions: CSV becomes a JSON array of objects keyed by the header row, and a JSON array of objects collapses back into CSV. Everything runs in your browser, so the data you paste never leaves your device.
How the conversion actually works
Going CSV to JSON, the tool reads the first non-empty line as the list of keys. Each following line becomes one object: the value in column 1 is attached to header 1, column 2 to header 2, and so on. So three columns named name,age,city turn every row into an object with exactly those three keys. The parser is quote-aware — it walks the line character by character, and when it meets a double quote it stops treating delimiters as separators until the closing quote, so a comma inside a quoted field is kept as data rather than splitting the cell. A doubled quote ("") inside a quoted field is correctly read as one literal quote character.
Going JSON to CSV, the tool takes the keys of the first object as the header row, then writes each object's values in that same column order. When it writes a cell, it automatically wraps the value in quotes if the value itself contains the delimiter, a quote, or a newline, and it escapes any embedded quotes by doubling them. That escaping is what keeps the output valid CSV that re-imports cleanly.
A worked example
Paste this CSV with the delimiter set to comma:
name,role,noteAda,engineer,"likes tea, biscuits"Grace,admiral,founder
Click CSV → JSON and you get an array of two objects. The first is {"name":"Ada","role":"engineer","note":"likes tea, biscuits"} — notice the comma stayed inside the note field because it was quoted, and the surrounding quotes were stripped. The output panel reports "2 rows". Turn off Pretty-print and the same data collapses to a single minified line; leave it on and the JSON is indented two spaces for readability. Now copy that JSON back into the input, click JSON → CSV, and the tool re-quotes Ada's note (because it contains a comma) so the round trip is lossless.
Choosing the right delimiter
The delimiter dropdown matters more than it looks. Comma is the default, but data exported from European spreadsheets often uses a semicolon, because the comma is their decimal separator. Tab-separated values (TSV) avoid the comma problem entirely and are common in scientific and database exports. Pick the delimiter that matches your source before converting — if you parse a semicolon file as comma-delimited, the whole row lands in a single mislabelled key. The same delimiter setting is used when writing CSV back out, so you can also use this tool to switch a file from semicolon to comma.
Use cases
- Feeding an API. Many web APIs accept JSON but not CSV. Export a spreadsheet to CSV, convert here, and paste the array straight into a request body or a seed file.
- Reviewing an API response. A JSON array of records is hard to scan; convert it to CSV and open it in a spreadsheet to sort and filter.
- Quick reshaping. Round-trip CSV to JSON and back to normalise inconsistent quoting, or to re-export with a different delimiter.
- Config and fixtures. Turn a small lookup table into a JSON array for test fixtures or front-end mock data.
Common mistakes to avoid
- Expecting type conversion. Every value comes out of the CSV parser as a string.
ageof 30 becomes"30", not the number30. If your program needs real numbers or booleans, cast them after import. - Unquoted commas. A field that contains a comma but isn't wrapped in quotes will be split into two columns and shift everything after it. Quote such fields in the source.
- Feeding JSON that isn't an array. The JSON → CSV direction requires a top-level array of objects. A single bare object or a nested structure raises a parse error, because CSV has no way to represent nesting in one flat grid.
- Ragged rows. If a row has fewer cells than there are headers, the missing keys are filled with empty strings rather than dropped — handy, but check that a short row was intentional and not a stray delimiter.
- Duplicate header names. Two columns with the same header collapse into one key in the object, because object keys must be unique. Rename duplicate columns before converting.