Skip to main content
CaseSwitch

CSV to JSON Converter

Use the CaseSwitch CSV to JSON Converter to turn a header row plus records into a JSON array of objects. Paste CSV, review the array, and copy it. Conversion runs in this browser so customer emails in a sample sheet are not uploaded.

Written by the CaseSwitch editorial team. We maintain these tools in the browser so drafts, keys, and images stay on your device.

Last reviewed: 23 July 2026

Processed locally in your browser. Nothing is sent to a server.

Paste or type text to convert. Output stays empty until there is input.

Character count: 0 · Word count: 0 · Line count: 0

Examples

Header plus two rows

Input

name,score
Ada,10
Bob,20

Output

[
  {
    "name": "Ada",
    "score": "10"
  },
  {
    "name": "Bob",
    "score": "20"
  }
]

Quoted field with comma

Input

city,note
"Paris, TX","ok"

Output

[
  {
    "city": "Paris, TX",
    "note": "ok"
  }
]

Empty field

Input

id,label
1,
2,x

Output

[
  {
    "id": "1",
    "label": ""
  },
  {
    "id": "2",
    "label": "x"
  }
]

Single column

Input

email
a@x.com
b@y.com

Output

[
  {
    "email": "a@x.com"
  },
  {
    "email": "b@y.com"
  }
]

Escaped quotes in a field

Input

name,quote
Ada,"She said ""hi"""

Output

[
  {
    "name": "Ada",
    "quote": "She said \"hi\""
  }
]

How to use

  1. Paste CSV with a header row (or adjust options if your tool UI exposes delimiter / header settings).
  2. Confirm each object key matches the header spelling you want in JSON.
  3. Copy the JSON array, then format or minify if needed.

What this tool is for

Analysts export CSV from Sheets; front-end tools and fixtures want JSON. This converter treats the first line as keys and later lines as objects, then pretty-prints a JSON array. It is for small datasets and prototypes — not a replacement for pandas on multi-gigabyte files.

How it works

Lines are split on newlines. Each line is parsed with CSV rules (commas, quoted fields, escaped quotes). With headers on (default), row 1 becomes property names and later rows become objects. Cell values stay strings in the JSON output. Empty input yields [].

When to use it

Fixture generation, prototyping a table UI, turning a small Sheets export into API-shaped JSON, and checking column names before wiring a mapper.

When not to use it

Excel locale exports may use semicolons — replace them or set the delimiter to match. TSV needs a tab delimiter. Do not use this as a database import for messy production extracts without validating row counts and encoding (UTF-8 vs Windows-1252).

How it compares to related tools

JSON Formatter cleans or minifies the result. Markdown Table Generator builds documentation tables from CSV-like rows. JSON to YAML is for YAML consumers.

Common mistakes

Assuming the first row is data when headers are enabled. Mismatched column counts silently filling missing cells as empty strings. Mojibake from non-UTF-8 exports. Expecting numbers to become JSON numbers — values remain strings.

Values stay strings

Cells are copied as JSON strings even when they look like numbers ("10"). Cast in your application or post-process if charts need real numbers. That behavior keeps leading zeros and phone-like fields safer than aggressive type guessing.

Delimiters and Excel exports

The default delimiter is a comma. European Excel exports often use semicolons — normalize in the spreadsheet or pass the matching delimiter if the UI allows it. Always keep a UTF-8 export when names contain accents.

Frequently asked questions

Does it support semicolons as separators?+

The converter is built around a configurable delimiter defaulting to commas. Replace semicolons with commas first if needed, or set the delimiter to match your export.

Are numbers converted to JSON numbers?+

No. Cells remain strings in the output objects. Cast later if you need numeric types.

What if a row has fewer columns?+

Missing cells become empty strings on the object for those headers.

Can I convert JSON back to CSV here?+

This page is CSV → JSON only. Use your spreadsheet or a dedicated JSON-to-CSV path for the reverse.

Is my CSV uploaded?+

No. Parsing runs in this browser.

How are quoted commas handled?+

Standard CSV quotes protect commas inside fields. Use double quotes inside a quoted field to escape a quote character.

Does this tool send my payload to CaseSwitch?+

No. Formatting, encoding, and naming conversions for this page run in your browser after load — your sample stays on the device.

Related tools

JSON Formatter

Debugging a 401 response, comparing two configs, preparing a gist, shrinking a JSON blob before embedding it in a test fixture, and checking whether a file is actually JSON before you commit it. If you need to escape a string as a JSON literal, use JSON Stringify instead. If you need YAML, use JSON to YAML after the JSON is valid.

Markdown Table Generator

README feature matrices, issue templates, design-doc option tables, and turning a small CSV paste into something GitHub will render.

JSON to YAML Converter

Turning a JSON API example into a values.yaml draft, comparing the same data in two syntaxes, and preparing a workflow fragment from a JSON fixture. Validate Kubernetes kinds and apiVersions separately.

JSON Stringify

Normalizing an API sample to a team indent, re-serializing a one-line fixture with 4-space indent, and checking that a paste is valid JSON before you commit it. If you only need pretty vs minify toggles, the [JSON Formatter](/json-formatter-minifier/) is the sibling tool. If you need to recover text from a quoted JSON string literal, use [JSON Unstringifier](/json-unstringifier/).

JSON Unstringifier

Cleaning a message copied from a JSON log line, extracting body text from a quoted fixture field, reversing accidental double wrapping when you only need the inner string, and teaching how JSON string escapes work.

YAML Formatter

Cleaning a workflow file snippet, reviewing a Helm values fragment, normalizing list indentation, and teaching YAML structure on a short sample.