Startseite CSV to JSON

CSV to JSON

Convert CSV data to formatted JSON instantly — handles quoted fields, commas and newlines, 100% in your browser.

Input

Output

Original
Result
Type

What is CSV?

CSV (Comma-Separated Values) is a simple text format for storing tabular data. Each line represents a row, and fields within a row are separated by commas. The first row often contains column headers. CSV is one of the oldest and most widely supported data formats — every spreadsheet application, database tool, and programming language can read and write it.

Despite its simplicity, CSV has a few rules for handling special cases. Fields that contain commas, quotes, or newlines must be wrapped in double quotes, and quotes within quoted fields are escaped by doubling them. This parser implements the standard CSV quoting rules (RFC 4180), so it correctly handles fields with embedded commas, newlines, and quotation marks.

CSV vs JSON

CSV and JSON serve different purposes. CSV is ideal for flat, tabular data — it's compact, human-readable, and universally supported by spreadsheet tools. JSON is better for nested, hierarchical data and is the standard format for web APIs and modern applications. Converting CSV to JSON makes tabular data easier to work with in JavaScript, APIs, and NoSQL databases.

The key difference is structure: CSV is always a flat table (rows and columns), while JSON can represent arrays, objects, and nested structures. When you convert CSV to JSON with headers, each row becomes an object with the header names as keys. Without headers, each row becomes an array of values.

When to convert CSV to JSON

Converting CSV to JSON is useful in many scenarios:

  • Web API preparation. Transform spreadsheet data into JSON for use in a web application or API.
  • Data migration. Move tabular data from a spreadsheet or database into a JSON-based system like MongoDB.
  • Configuration files. Convert tabular configuration data into JSON format for use in JavaScript applications.
  • Data analysis. Load CSV data into a JavaScript-based analysis tool or charting library that expects JSON.
  • Prototyping. Quickly turn sample data from a spreadsheet into JSON for prototyping and testing.

How to convert CSV to JSON

Converting CSV to JSON with this tool takes a second and happens entirely in your browser. Follow these steps:

  1. Set options. Check "Has Header Row" if the first line of your CSV contains column names. Uncheck it if your CSV has no headers.
  2. Paste your CSV. Click inside the input box and paste your CSV data. The parser handles quoted fields, embedded commas, and multi-line fields.
  3. Click "Convert" and copy. The JSON output appears in the output box. Click "Copy" or "Download" to save it.

With headers, each row becomes an object like {"name":"Alice","age":"30"}. Without headers, each row becomes an array like ["Alice","30"]. All values are treated as strings — convert them to numbers or booleans in your code if needed.

Handling quoted fields and special characters

This parser implements the RFC 4180 standard for CSV quoting. If a field contains a comma, newline, or double quote, it must be enclosed in double quotes. Double quotes within a quoted field are escaped by doubling them. For example, the field He said "hello" is written in CSV as "He said ""hello""". The parser handles these cases correctly.

Note that all values in the JSON output are strings, even if they look like numbers or booleans. This is because CSV does not carry type information — every field is text. If you need typed values, you can post-process the JSON in your code to convert numeric strings to numbers, "true"/"false" to booleans, etc. The tool also handles different line endings (\n, \r\n) and trims empty trailing rows automatically.

Is this CSV to JSON converter free?

Yes, completely free with no sign-up, no limits beyond your device's memory, and no upload — everything runs locally.

Does it handle fields with commas and quotes?

Yes. The parser implements RFC 4180 standard CSV quoting. Fields containing commas, newlines, or quotes are properly handled when they are enclosed in double quotes.

Are numbers converted to JSON numbers?

No. CSV does not carry type information, so all values are output as strings. You can convert them to numbers or booleans in your code after parsing.

Is my data uploaded?

No. All conversion is local. Your CSV data never leaves your browser.