मुख्य सामग्री पर जाएँ
Tools Star Hub

CSV से JSON

हेडर पंक्ति वाले CSV को JSON में बदलें, कोट्स के अंदर कॉमा और एस्केप किए गए कोट्स समेत।

टूल लोड हो रहा है…

यह टूल आपके ब्राउज़र में चलता है। इनपुट, फ़ाइलें और बनाए गए मान इसी डिवाइस पर रहते हैं। पसंदीदा और हाल में इस्तेमाल किए गए टूल, अगर आप इनका उपयोग करते हैं, लोकल स्टोरेज में केवल टूल के नाम सहेजते हैं — कभी पासवर्ड, दस्तावेज़ या QR सामग्री नहीं। गोपनीयता नीति देखें।

इस टूल की विस्तृत गाइड (इस्तेमाल का तरीका, उदाहरण और अक्सर पूछे जाने वाले सवाल) फ़िलहाल अंग्रेज़ी में है।

What this tool does

Paste CSV whose first row is the column names. You get a JSON array of objects, either spaced for reading or compact for a file.

How to use

  1. Paste the CSV, including the header row.
  2. Choose Formatted JSON or Compact JSON.
  3. Press Convert to JSON.
  4. Copy the JSON, download data.json, or clear the form.

Examples

  • A small sheet

    name,age then John,30 and Sara,25 becomes two objects with name and age. Age stays a string, because CSV cells are text.

  • A quoted comma

    The row "Doe, Jane",25 keeps Doe, Jane as one name. The comma inside the quotes is not a new column.

Main features

  • Quoted cells can contain commas and line breaks.
  • A doubled quote inside a quoted cell becomes one quote.
  • Empty cells stay empty strings.
  • A blank header is named column_1, column_2, and so on. Duplicate headers get a numeric suffix.

How it works

The parser walks the text. A quote starts a cell, and the next undoubled quote ends it. A comma outside quotes starts a new cell. A line break outside quotes starts a new row. The first row becomes the keys. Later rows become objects. A row with more cells than the header is rejected so extra values are not dropped.

Tips

  • If a spreadsheet exported numbers, they will still be JSON strings. Convert them in your own code if you need numbers.
  • Use compact JSON when you are pasting into a request body. Use formatted JSON when you want to read it.

Limitations

There is no option to skip the header or to pick a different delimiter. A semicolon-separated file will not split on semicolons. A row that is longer than the header stops the conversion.

See the disclaimer for what these tools do not cover.

FAQ

What if a quote is missing?
An unclosed quote, or a quote in the middle of an unquoted cell, shows an error instead of a partial JSON file.
Are empty cells null?
No. An empty cell becomes an empty string so you can see that the column was present.
Is my input sent to a server?
No. The CSV stays in this tab while it is parsed. It is not sent to a server.
How do I convert a spreadsheet to JSON?
Save or export the sheet as CSV with a header row, paste it here, and convert. Each row becomes an object that uses the headers as keys.
Are numbers converted to JSON numbers?
No. CSV has no data types, so every cell becomes a JSON string, such as "42", and an empty cell becomes an empty string. Convert numbers in your own code if you need them.