Dev Tools ยท Free

CSV to JSON
Converter

Paste a CSV or drop a file, get structured JSON back. Handles quoted fields, type inference, and empty cells โ€” without writing a line of code.

No server uploadType inferenceRFC 4180 compliant

What it does

From flat rows to structured objects

CSV is fundamentally flat โ€” rows and columns with no concept of types, nesting, or structure. JSON is what modern applications actually consume: typed objects with string keys, where numbers are numbers and booleans are booleans. The conversion sounds simple, but done naively it breaks constantly on real-world data โ€” a comma inside a city name, a quoted field containing line breaks, a boolean that looks like a string.

This tool reads your first row as headers and maps every subsequent row into a JSON object using those headers as keys. It also infers types: cells that contain 95.5, true, or false become native JSON values rather than strings. The result is immediately usable in code without a separate sanitization step.

CSV input

user_id,full_name,active,score
101,"Doe, Jane",true,95.5
102,"Smith, John",false,88

JSON output

[
  {
    "user_id": 101,
    "full_name": "Doe, Jane",
    "active": true,
    "score": 95.5
  },
  {
    "user_id": 102,
    "full_name": "Smith, John",
    "active": false,
    "score": 88
  }
]
โœ“ Comma in "Doe, Jane" โ†’ handled correctlyโœ“ 101 โ†’ number, not stringโœ“ true โ†’ boolean, not string

Use cases

The workflows this actually fits into

Seeding a database

When moving from a legacy system, data is usually exported as CSV. Converting it to a JSON array is the standard first step for seeding a MongoDB collection, a DynamoDB table, or a Postgres insert via Prisma.

MongoDB ยท DynamoDB ยท Supabase

Front-end mock data

Before the API is ready, front-end engineers often work against static JSON files. Export your test data from a spreadsheet, convert it here, save it as a local file, and import it as mock state in React, Vue, or any other framework.

React ยท Vue ยท Next.js

API payload preparation

Marketing and ops teams maintain lead lists, product catalogs, and user segments in spreadsheets. Converting these to JSON makes it straightforward to loop through and construct the payloads needed for bulk API calls โ€” SendGrid, Mailchimp, Stripe, or any REST endpoint.

SendGrid ยท Mailchimp ยท REST APIs

Processing open data

Government datasets, census data, geographic reference files, and public APIs almost always export as CSV. Converting to JSON is the necessary first step before loading into a mapping library like Mapbox, a charting library, or a data pipeline.

Mapbox ยท D3 ยท Python pipelines


CSV vs JSON

Why the two formats exist โ€” and why you often need both

CSV and JSON are designed for different things. CSV was built for humans editing data in spreadsheets โ€” it's compact, universally readable, and exports cleanly from Excel, Google Sheets, and virtually every database. JSON was built for machines โ€” it carries type information, supports nested structures, and is the native format for JavaScript, REST APIs, and NoSQL stores. The problem is that data almost always originates in one format and needs to be consumed in the other.

CSV is better for

  • โ€บSharing data between people and teams
  • โ€บEditing in spreadsheet applications
  • โ€บCompact storage of tabular records
  • โ€บImporting into Excel, Google Sheets, Airtable
  • โ€บDatabase exports and ETL sources

JSON is better for

  • โ€บApplication and API data consumption
  • โ€บRepresenting nested or hierarchical structures
  • โ€บNative type support (numbers, booleans, null)
  • โ€บNoSQL database documents
  • โ€บReact state, fetch responses, config files

Edge cases

Where naive converters break โ€” and what this one does instead

Most quick-and-dirty CSV parsers fail on real-world data. A simple split(",") on each line shatters the moment a field contains a comma โ€” which is common in names, addresses, and any freeform text. Here's how this parser handles the cases that usually cause problems:

Commas inside quoted fields

The RFC 4180 spec says any field containing a comma must be wrapped in double quotes. This parser reads the quotes as field delimiters and treats everything inside as a single value โ€” so "Smith, John" becomes the string Smith, John in JSON, with no column shift.

"Smith, John"

Escaped internal quotes

When a field value itself contains a double quote, CSV represents it as two consecutive double quotes. The parser de-escapes these correctly, so "The ""Pro"" Model" becomes the string The "Pro" Model in JSON.

"The ""Pro"" Model"

Semicolon-delimited files

European locales commonly export CSV files using semicolons as the delimiter rather than commas. This is a common source of one-column JSON output when using a comma-only parser. Use the delimiter option in the tool to switch before parsing.

name;city;score

Empty cells

An empty cell is represented as null in the JSON output rather than an empty string โ€” which is semantically correct and easier to handle in application code with a null check rather than checking for "".

101,,active

Missing or absent headers

The parser requires the first row to be headers. If your CSV starts with data, the first row will be used as JSON keys โ€” which is almost never what you want. Add a descriptive header row before converting. If your source doesn't have headers, use generic ones like col_1, col_2.

No header row

Limitations

When this tool is enough โ€” and when it isn't

โœ“ This tool handles it

  • Flat CSV files from Excel, Google Sheets, or any CRM export
  • Files with standard headers in the first row
  • Quoted fields containing commas, line breaks, or internal quotes
  • Number and boolean type inference
  • Comma, semicolon, or tab delimiters
  • One-time or ad-hoc conversions

โœ— Use a library for these

  • Files over ~50 MB (browser memory limits apply)
  • Streaming large datasets row-by-row
  • Automated pipelines that run on a schedule
  • Complex nested JSON output from a flat CSV source
  • Custom validation rules per column
  • Server-side processing at scale

For pipelines: PapaParse (JS), pandas (Python), or csvkit (CLI) are good starting points.


FAQ

Common questions

Does the output always come out as an array?

Yes. A CSV with multiple rows maps naturally to a JSON array of objects. Each row becomes one object; each column header becomes a key. If your CSV has one row of data plus headers, you still get a single-element array.

What happens to empty cells?

Empty cells are represented as null in the JSON output rather than empty strings. This is the more semantically correct representation and easier to handle in code โ€” you check for null rather than checking for an empty string.

Can I convert Excel files directly?

Not directly โ€” this tool parses CSV text. To convert an Excel file, open it in Excel or Google Sheets, go to File โ†’ Save As โ†’ CSV, then paste or upload the resulting file here.

Is my data safe to use here?

Yes. All processing runs in your browser. Your CSV text is never sent to a server. This makes it safe to use with internal company data, customer lists, or any file you'd rather not share with a third-party service.

What's RFC 4180?

RFC 4180 is the closest thing CSV has to a formal specification. It defines how fields with commas, line breaks, and quotes should be handled. Most modern tools claim RFC 4180 compliance, but many miss edge cases. This parser follows the spec correctly for the cases that commonly cause breakage.

My output has all data in one key โ€” what's wrong?

This usually means your file uses a different delimiter. If the entire row is appearing as a single key, your CSV probably uses semicolons or tabs instead of commas. Switch the delimiter option in the tool and re-parse.

๐Ÿ”’

Your data never leaves your browser

CSV files often contain sensitive data โ€” customer lists, employee records, financial exports. Everything this tool does runs in local browser memory using JavaScript. No file content, no converted JSON, and no metadata is transmitted to Kodivio's servers or any third party. Closing the tab clears the data completely.

Feedback

Live