Skip to content
Data2026-05-08Begin4 min read

Online CSV/JSON Converter: Convert Between Table Data Formats

What Are CSV and JSON

CSV (Comma-Separated Values) is tabular text: a header row, then one record per row, fields separated by commas by default.

JSON expresses objects and arrays for APIs and programs. ToolVault's CSV/JSON Converter converts both ways in the browser — nothing is uploaded.

Comparison example (matches this site's output)

CSV:

name,email,age
Alice,alice@example.com,28
Bob,bob@example.com,32

JSON (all strings — this tool does not infer types):

[
  { "name": "Alice", "email": "alice@example.com", "age": "28" },
  { "name": "Bob", "email": "bob@example.com", "age": "32" }
]

Note age stays "28", not the number 28. Coerce per column downstream when you need numeric types.

CSV vs JSON

FeatureCSVJSON
ReadabilityTabularStructured
NestingFlatten or lose itNative
TypesText onlyString, number, boolean, null, …
Typical useSpreadsheets, bulk tablesAPIs, nested payloads
ExcelOpens directly (watch encoding/delimiter)Needs a table first

How to use this converter (real UI)

Open the CSV/JSON Converter:

  1. Paste CSV (with a header) or a JSON array of objects on the left.
  2. Click CSV → JSON or JSON → CSV — the tool does not auto-detect direction and does not sniff delimiters.
  3. Choose a delimiter: comma ,, semicolon ;, or Tab (shared for parse and emit).
  4. Copy or download the result.

Implementer's notes (csvToJson / jsonToCsv)

Delimiter

  • UI offers , / ; / Tab; the second argument to csvToJson / jsonToCsv matches the control.
  • Locale Excel exports that use ; can be pasted directly with the semicolon option—no need to pre-normalize via CSV/TSV.

Quoting (RFC 4180 subset)

  • Fields with commas, quotes, or newlines must be wrapped in "...".
  • Escape quotes by doubling: "said ""hi""" → said "hi".
  • A " mid-field (not starting the field) → CSV_QUOTE_POSITION_ERROR.
  • Unclosed quotes → CSV_QUOTE_NOT_CLOSED.
  • Newlines inside quotes are legal (one logical record can span physical lines).

Headers

  • Row 0 is the header; keys are trimmed.
  • Header-only input → [].
  • Blank input → [].

Empty cells and column counts

  • Empty cells become "", never JSON null.
  • Every data row must match the header width or you get CSV_FIELD_COUNT_MISMATCH.
  • Fully blank rows are skipped.

Newlines and BOM

  • \n and \r\n are accepted (\r alone is skipped).
  • The whole input is trim()'d; JS trim strips a leading UTF-8 BOM (U+FEFF), so Excel "CSV UTF-8" headers usually do not become BOM+name.
  • If another toolchain keeps the BOM on the first header, that path did not strip it — this one does.

JSON → CSV extras

  • Input must be an array of objects.
  • Headers are the union of keys (first-seen order); missing keys become empty cells.
  • null / undefined → empty cell.
  • Values starting with =, +, -, @, etc. get a leading tab to reduce Excel/WPS formula injection risk.
  • Fields with ,, ", or newlines are RFC-quoted.

Large-file boundary

  • The full string is held in memory; fine for interactive and mid-size tables.
  • Hundreds of thousands of rows or ~100MB+ blobs belong in streaming CLIs or database loaders — not a tab.

RFC 4180, Excel dialects, and the real cracks

RFC 4180 describes a common shape (comma + quotes + CRLF) but is not globally enforced:

  • Delimiter follows locale — German Excel often emits ;; this tool stays on ,.
  • Quoting is "when needed" — exporters that skip quotes corrupt the first important address field.
  • Record ≠ physical line — quoted newlines break naive split('\n') scripts.
  • BOM — decides whether the first header join fails silently.

Treat CSV as a dialected text table, not "JSON with commas".

Round-trips are not identity

Even staying on this site:

  • Types stay strings end-to-end (predictable — no silent 00123 → 123).
  • Column order after JSON→CSV follows key-union scan order, which may differ from the original CSV.
  • CSV has no null; the return trip will not invent one.
  • Nested objects are not flattened here. For dotted keys and custom delimiters, use JSON → CSV.
Next stepTool
Flatten nested JSONJSON → CSV
Semicolon / TSVCSV/TSV
Dev-db INSERT demosCSV → SQL
Pretty-print SQLSQL formatter
Config shapeYAML ↔ JSON
Structure checksJSON Schema

Related posts: JSON/CSV guide, CSV to SQL, YAML/JSON.

Failure cheat sheet

SymptomLikely causeFix
CSV_FIELD_COUNT_MISMATCHExtra/missing commas or unquoted commasQuote the field or normalize via TSV
CSV_QUOTE_NOT_CLOSEDOdd unpaired "Close or remove the quote
MojibakeGBK/other bytes pasted as UTF-8Re-encode to UTF-8
One giant columnSemicolon fileCSV/TSV converter first
Excel formula surpriseCell starts with =JSON→CSV here prefixes a tab; hand-authored CSV needs care

FAQ

Commas inside fields?

Wrap in quotes: "Shanghai, Pudong". Or switch to TSV via CSV/TSV.

Why are numbers still strings?

CSV→JSON here deliberately skips type inference so order IDs and leading zeros survive. Coerce in the app or with SQL CAST.

Difference from the JSON→CSV tool?

  • CSV/JSON: both directions, fixed comma, string values, strict column counts.
  • JSON→CSV: JSON-first export, optional flatten, custom delimiter, header toggle.

Large files?

Interactive sizes yes; 100MB+ use a local pipeline. Browser memory roughly doubles (source string + object graph).


From ToolVault. Related: CSV/JSON, JSON→CSV, CSV→SQL, YAML↔JSON. More on the homepage.