Logo
Prompt Minds

CSV to JSON Converter

Paste or drop a CSV and get clean JSON — an array of objects, an array of rows, or an object keyed by ID — with real numbers, booleans and optional nesting.

CSV पेस्ट करें या फ़ाइल डालें और साफ़ JSON पाएँ — ऑब्जेक्ट, ऐरे या नेस्टेड।

100% private — runs in your browser · Last Updated: October 2026
—
PDNob logoPDNob Your Lightweight AI-Powered PDF Editor Edit · Convert · Compress · OCR · AI Download for Desktop

Quick Tips

Use dotted headers for nested JSON
Choose keyed output for lookups by ID
Leading zeros stay as strings
Minify for APIs, pretty-print for reading
Skip empty cells for smaller JSON
All Tools
Advertisement

Quick Answer

Paste your CSV or drop a .csv file and the JSON appears instantly below. By default each row becomes an object whose keys come from the header row, numbers become JSON numbers and true/false become booleans, while values like 080001 stay strings. You can switch to an array of arrays or an object keyed by the first column, nest dotted headers like address.city, then copy or download the .json file.

What Is CSV to JSON Conversion?

CSV stores a table as plain text lines; JSON (JavaScript Object Notation) stores structured data as objects and lists. Spreadsheets, databases and business software export CSV, while web apps, APIs, mobile apps, NoSQL databases and configuration files speak JSON. Converting between them is one of the most common everyday tasks for developers, data analysts, testers and no-code builders.

This CSV to JSON converter (CSV से JSON) reads your CSV with the battle-tested PapaParse library and builds JSON in the shape you need. It types values sensibly, can create nested objects from dotted column names, and never uploads your data — everything happens in the browser tab.

How to Use It

  1. Paste CSV into the text box or drop a .csv / .tsv file. A sample is loaded so you can see how it works.
  2. Check the delimiter: auto-detect works for most files; choose one manually if columns look merged.
  3. Pick the JSON shape — array of objects, array of arrays or keyed object.
  4. Adjust options: typing, nesting, skipping empty cells and indentation.
  5. Copy or download the result. The status line shows how many records were created and the output size.

The Three Output Shapes

Take this CSV:

id,name,score
101,Asha,91
102,Rohit,78
ShapeResultBest for
Array of objects[{"id":101,"name":"Asha","score":91}, …]APIs, front-end apps, MongoDB imports
Array of arrays[["id","name","score"],[101,"Asha",91], …]Charts, compact storage, spreadsheets in code
Keyed by first column{"101":{"id":101,"name":"Asha","score":91}, …}Fast lookups by ID, translation files, config maps

Array of objects is the most common and the default. In keyed mode, if two rows share the same key, the later row wins — make sure the first column is unique.

Smart Typing Without Data Loss

CSV has no types; every cell is text. Many converters either leave everything as strings (so "91" can't be summed without conversion) or convert everything that looks numeric (so a PIN code 080001 becomes 80001). This tool uses a careful rule when typing is on:

  • Numbers: plain values like 42, -3.5 or .75 become JSON numbers.
  • Booleans: true/false (or TRUE/FALSE) become JSON booleans.
  • Kept as strings: anything with a leading zero (080001, 007), a plus sign (+91…), thousands separators (1,250), currency symbols, dates, or more than 15 digits.

The 15-digit limit matters because JavaScript numbers lose precision beyond about 15–16 significant digits: 12345678901234567 would silently become 12345678901234568. Keeping long IDs, account numbers and order numbers as strings prevents that bug entirely.

Building Nested JSON from Flat Columns

A CSV is flat, but JSON often needs structure. Name your columns with dots and tick Nest dotted headers:

name,address.city,address.pin
Asha,Patna,800001

becomes

[{"name":"Asha","address":{"city":"Patna","pin":800001}}]

You can nest as deep as you like (contact.phone.mobile). This is the exact reverse of the flattening done by our JSON to CSV converter, so you can round-trip data: export JSON to CSV, edit it in Excel, and convert it back to the same nested structure. For safety, special keys such as __proto__ and constructor are ignored so a malicious file cannot tamper with JavaScript objects.

Headers: Duplicates, Blanks and Spaces

  • Duplicate headers (two "Phone" columns) become Phone and Phone_2, so neither value is lost.
  • Blank headers become column1, column2 and so on.
  • Spaces and symbols are kept exactly — "First Name" stays "First Name", which is valid JSON. Rename columns in the CSV if your code needs camelCase keys.
  • No header row? Choose "Array of arrays" to keep every row as data.

Common Uses

  • Seeding databases: turn a spreadsheet of products, cities or users into JSON for MongoDB, Firebase or test fixtures.
  • Front-end apps: load a static JSON file of FAQs, prices or store locations exported from a sheet.
  • Mock APIs: create realistic sample responses for prototypes and testing.
  • Translations: keyed output turns a key/English/Hindi sheet into lookup objects.
  • Charts and dashboards: array-of-arrays output feeds charting libraries directly.
  • No-code tools: paste JSON into automation platforms that accept JSON payloads.

Pretty vs Minified Output

Pretty-printed JSON (2 or 4 spaces) is easy to read and review in code. Minified JSON removes all whitespace, which makes files noticeably smaller — useful for API payloads, local storage or bundling into apps. The status line shows the exact output size so you can compare. To validate or reformat JSON later, use our JSON Formatter.

Skipping Empty Cells

By default an empty cell becomes an empty string (""), so every object has the same keys — predictable for code that expects a fixed structure. Tick Skip empty cells to leave those keys out instead, which produces smaller JSON for sparse data such as optional fields or survey responses. Choose whichever your application expects.

Parsing Details

  • Quoted fields with commas, quotes ("") or line breaks are handled according to RFC 4180.
  • Delimiters: comma, semicolon, tab or pipe — auto-detected.
  • Encoding: UTF-8 is read correctly, including Hindi and emoji; a BOM at the start is removed so the first key isn't corrupted.
  • Blank lines are skipped, and rows with uneven columns are reported in the status line.

CSV vs JSON at a Glance

CSVJSON
StructureFlat rows and columnsNested objects and arrays
Data typesNone — all textStrings, numbers, booleans, null
File sizeSmaller (keys written once)Larger (keys repeated per record)
Edited inExcel, Google SheetsCode editors
Typical useExports, imports, reportsAPIs, apps, configuration

A common workflow is to let non-technical colleagues maintain data in a spreadsheet, export it as CSV and convert it to JSON for the website or app — no developer needs to retype anything.

Using the JSON in Your Code

Download the file (for example data.json) and place it in your project. In a browser app, load it with fetch('data.json').then(r => r.json()); in Node.js, read it with JSON.parse(fs.readFileSync('data.json', 'utf8')); in Python, use json.load(open('data.json', encoding='utf-8')). Because numbers and booleans are already typed, you can sort, filter and calculate immediately without converting strings. If you plan to import into MongoDB with mongoimport, use the array-of-objects shape with the --jsonArray flag.

Large Files

You can load CSV files up to 50 MB. Converting tens of thousands of rows takes a moment and uses memory in proportion to the data, so a laptop or desktop browser is best for very large files. The output box shows only the first 200,000 characters to keep the page responsive, but Copy and Download always include the complete JSON. If the file is too large to handle comfortably, split it first with our Split CSV tool and convert the parts.

Tips for Clean JSON

  • Use short, code-friendly headers such as id, name, price — they become your JSON keys, and keys without spaces are easier to use in code (item.price instead of item["Price (₹)"]).
  • Keep one value per cell. If a cell holds a list like "red; blue", split it in your code, or use separate columns such as colors.primary and colors.secondary with nesting turned on, which gives you a small colors object for every record.
  • Write booleans as true/false rather than yes/no if you want JSON booleans.
  • Avoid totals rows at the bottom of the sheet — they would become an extra record.
  • Use a unique first column when choosing the keyed shape — an ID, roll number or SKU works well, and duplicates would otherwise overwrite each other.

Following these simple habits gives you JSON that drops straight into your application without any clean-up code.

Privacy

CSV files often contain customer lists, phone numbers or business data. This converter runs entirely in your browser with an open-source parser; your data is never uploaded, logged or stored, and it disappears when you close the tab.

Troubleshooting

  • All data in one key: the delimiter wasn't detected — choose semicolon or tab manually.
  • A number stayed a string: it probably has a leading zero, comma, currency sign or space. That is deliberate; clean the column if you need numbers.
  • Garbled characters: re-save the CSV as UTF-8 from the program that created it.
  • Missing rows in keyed mode: duplicate keys in the first column overwrite each other — use array of objects instead.

Quick Glossary

  • JSON: a text format for objects {} and arrays [], used by almost every web API.
  • Delimiter: the character separating columns in a CSV.
  • Minify: remove whitespace to make data smaller.
  • Round-trip: converting data out and back again without changing it.

Why Use This Converter?

It gives you three useful shapes, smart typing that never corrupts IDs, true nesting from dotted headers, and complete privacy — free. Need other formats? Try CSV to XML, CSV to Excel or XML to JSON.

CSV to JSON Converter — Key Facts

InputCSV, TSV or pasted text
ShapesObjects, arrays, keyed object
TypesNumbers & booleans (optional)
Leading zerosKept as strings
Nestingaddress.city → {address:{city}}
PrivacyRuns in your browser

Frequently Asked Questions

How do I convert CSV to JSON?

Paste the CSV into the box or drop a .csv file. The JSON is generated instantly; copy it or download it as a .json file.

What JSON shapes can I get?

An array of objects (one object per row, keys from the header), an array of arrays (each row as a list), or an object keyed by the first column — handy for lookups by ID.

Are numbers converted to JSON numbers?

Yes, when 'Convert numbers and true/false' is on. Plain numbers like 42 or 3.5 become numbers and true/false become booleans.

Will leading zeros be lost?

No. Values such as 080001, 007 or +919876543210 and IDs longer than 15 digits stay strings, so nothing is changed.

How do I create nested JSON from CSV?

Name columns with dots, such as address.city and address.pin, and tick 'Nest dotted headers'. They become {"address": {"city": …, "pin": …}}.

What if my header has duplicate or empty names?

Duplicates get a suffix (name, name_2) and empty headers become column1, column2 and so on, so no data is overwritten.

Does it handle commas and line breaks inside quotes?

Yes. Quoted fields with commas, quotes or line breaks are parsed correctly by PapaParse.

Which delimiters are supported?

Comma, semicolon, tab and pipe, detected automatically or chosen manually.

Is there a size limit?

Files up to 50 MB can be loaded. The on-screen preview is cut at 200,000 characters, but Copy and Download include everything.

Are my files uploaded?

No. Parsing and conversion happen in your browser; nothing is sent to a server.

How do I convert JSON back to CSV?

Use our JSON to CSV converter, which flattens nested objects into columns.

Is it free?

Yes, completely free with no sign-up.

CSV to JSON, Done Right!

Typed, nested and private — free.

Explore More Prompt Minds Tools

CSV to JSON Converter works great alongside our other free tools. Every Prompt Minds tool runs entirely in your browser — no sign-up, no uploads, no watermarks. Browse all free tools.

Prompt Minds AI Assistant
Namaste! How can I help you with CSV to JSON Converter?