Developer Guides
How to Convert CSV to JSON and Check Your Data

Convert CSV to JSON with the right delimiter and header settings. Check quoted fields, missing values, duplicate names, and data types before importing.
To convert csv to json, choose the correct delimiter, decide whether the first row contains column names, and convert the resulting rows into JSON. Before importing the output elsewhere, check the values and structure: a valid JSON file can still contain incomplete or incorrectly mapped records.
MayreDukaan’s CSV to JSON converter accepts pasted text or a chosen CSV file. Conversion runs in your browser. It supports comma, semicolon, and tab delimiters, with a separate First row is header option.
CSV versus JSON: what changes?
CSV represents tabular records as fields separated by delimiters. RFC 4180 documents the common comma-separated form, including quoting rules. Semicolon- and tab-separated exports need matching delimiter choices rather than blindly using the default comma.
JSON supports objects, arrays, strings, numbers, booleans, and null. A flat CSV table does not itself specify how to build nested objects or which columns should become numbers. Those decisions depend on your target data contract.
| Converter setting | Result structure | Good fit |
|---|---|---|
| First row is header enabled | Array of objects | Named columns in an exported table |
| First row is header disabled | Array of arrays | Positional rows without headings |
| Comma delimiter | Commas separate fields | Conventional CSV |
| Semicolon or Tab | Selected character separates fields | Corresponding spreadsheet exports |
The converter preserves cell values as strings rather than guessing types. That can protect a code such as 0012 from becoming 12, but a numeric API field will still need deliberate type conversion later.
Convert a file step by step
- Open the converter and paste the table, or select Or choose a file.
- Pick Comma, Semicolon, or Tab to match the export.
- Leave First row is header enabled only if the first record contains column names.
- Press Convert and inspect several records in Output.
- Check the first and last record, a blank cell, and a record containing punctuation.
- Copy the result or download data.json.
- Test a small sample in the receiving application before importing everything.
The file picker has a 20 MB-labelled size check. This is an interface limit for selected files, not a guarantee that every large pasted dataset will be convenient to process. Keep the original export unchanged so that you can repeat the conversion after correcting settings.
Practical example with a quoted comma
Suppose your first line is name,code,quantity. The next record is "Notebook, lined",0012,3. Choose Comma and enable headers. The resulting record contains the keys name, code, and quantity, with the values "Notebook, lined", "0012", and "3".
The comma inside the quoted product name remains part of that value. The quantity stays a JSON string, even though it looks numeric. If your application requires a number, convert it through a controlled transformation after validating the expected range and meaning.
Use the JSON formatter to inspect the resulting structure. Formatting confirms syntax and improves readability; it does not decide whether quantity should be a number or whether a code is correct.
Quoting rules that prevent broken columns
RFC 4180 describes double-quoted fields for values containing commas, quotation marks, or line breaks. A literal double quotation mark inside such a field is represented by two double quotation marks. The converter handles quoted delimiters, doubled quotes, and line breaks inside quoted fields.
Do not replace every comma with a line break or split the file by commas in a text editor. Either action can corrupt legitimate quoted values. If conversion reports an unclosed quoted field, repair the export or the source value rather than deleting quotation marks throughout the file.
A newline inside a quoted description is part of that cell. It is not necessarily a new record. Compare record counts using parsed records rather than assuming every visible line corresponds to a separate item.
Check headers and uneven rows
Header mode trims spaces around column names. Blank names become generated names such as column2. Duplicate names can overwrite earlier values in the same object, so give every column a distinct meaningful heading before converting.
The converter fills missing cells with empty strings when mapping rows to headers. Cells beyond the available header columns are not included in the resulting objects. It does not provide a complete row-width audit, so inspect irregular rows before accepting the output.
Completely empty single-cell rows are skipped. An empty string is not the same JSON value as null, false, or zero. If those distinctions matter to your import, define and apply explicit rules instead of relying on visual similarity.
Common mistakes and a final review
- Selecting header mode when the first row is real data.
- Choosing the wrong delimiter and getting one long field per record.
- Assuming dates and numeric-looking values were automatically typed.
- Ignoring duplicate headings or surplus cells.
- Treating successful conversion as proof of compatibility with an API.
For a reverse export, the JSON to CSV converter is a separate tool; do not assume every nested JSON structure has a lossless tabular equivalent. Start with a small, representative sample in the CSV to JSON converter, confirm its mapping, and only then process the full table.
Frequently asked questions
Does the converter turn numeric cells into numbers?
No. It preserves cell contents as strings, including numeric-looking values.
What if my CSV has no header row?
Disable First row is header to produce an array of arrays without consuming the first record as column names.
Can duplicate headers lose data?
Yes. Repeated property names can overwrite earlier mapped values. Rename duplicate columns before converting.
Useful on MayreDukaan
Sources
Facts last checked against these sources on 15 Nov 2026, 07:43 Pakistan time.
Images: Illustration created for MayreDukaan (not a photo)
More trending articles
EntertainmentWatch Pakistani News Live Through Official Links15 Nov 2026 · 4 min read
Pakistani DramasWatch Pakistani Dramas Online on Official Channels15 Nov 2026 · 5 min read
Shopkeeper GuidesTake Your Shop Online in Pakistan: Setup Guide15 Nov 2026 · 4 min read
Shopkeeper GuidesInstall the MayreDukaan APK on Android: A Guide15 Nov 2026 · 4 min read