Developer Tools
CSV & JSON Converter
Convert structured CSV and JSON data in either direction.
Converted output will appear here.
CSV to JSON treats the first row as unique column headers and keeps cell values as strings. JSON to CSV accepts an array of objects and uses the union of their keys as columns.
About This Tool
CSV is convenient for spreadsheets and tabular exports, while JSON is common in APIs, configuration, fixtures, and application data. This converter moves structured records between the two formats without uploading the input. It handles CSV quoting rules that simple comma splitting gets wrong, including commas, escaped double quotes, and line breaks inside quoted fields.
How To Use It
- Choose CSV to JSON or JSON to CSV.
- Paste or edit the source data. For CSV to JSON, the first row becomes the object keys and every following row must contain the same number of fields.
- Select Convert and review the generated output. Validation errors identify malformed CSV structure or incompatible JSON shapes instead of silently dropping data.
- Copy the result into a spreadsheet, API fixture, script, configuration workflow, or another Hanakash developer tool.
Examples
Spreadsheet export to API fixture
Convert a CSV headed name,city into a JSON array such as [{"name":"Ada","city":"London"}]. CSV cell values intentionally remain strings because CSV itself does not carry reliable type metadata.
Comma inside a CSV cell
A value such as "London, UK" stays one field when it is enclosed in double quotes. The parser also converts doubled quotes inside quoted fields back to literal quote characters.
JSON objects with different keys
When JSON records do not all contain the same properties, the CSV header uses the union of keys in first-seen order. Missing values become empty CSV cells rather than removing columns.
Useful Notes
CSV quoting rules
A CSV field containing a comma, quote, carriage return, or line feed must be quoted. A literal double quote inside a quoted field is represented by two double quotes. The parser supports CRLF, LF, and CR row endings and quoted multiline fields.
CSV headers and row shape
CSV to JSON treats the first record as column names. Headers must be non-empty and unique, and every data row must have the same number of fields. These checks prevent ambiguous object keys and silent column shifts.
CSV values remain strings
The converter does not guess whether 00123 is a number, identifier, date, Boolean, or text. Automatic type inference can corrupt identifiers and formatting, so CSV cells are preserved as strings in JSON.
JSON shape for CSV output
JSON to CSV requires a top-level array whose items are objects. Primitive array items do not have column names. Nested objects and arrays are serialized as JSON text inside their CSV cell rather than flattened into invented columns.
Local processing
Parsing and conversion run in browser JavaScript. This tool does not send pasted CSV or JSON to an API, which makes it suitable for ordinary local transformation workflows while still requiring normal care with sensitive data on your own device.
FAQ
Does this support commas inside CSV values?
Yes. Put a field containing commas inside double quotes. The parser follows standard CSV-style quoting and also supports escaped quotes and line breaks inside quoted fields.
Why are CSV numbers strings in JSON?
CSV does not define dependable data types. Preserving text avoids changing values such as postal codes, account-like identifiers, leading-zero codes, or date-looking strings without your instruction.
What happens to missing JSON properties?
The converter builds columns from all keys encountered across the object array. A record that lacks one of those keys gets an empty cell in that column.
Is my data uploaded?
No. CSV parsing, JSON parsing, and output generation happen locally in your browser.
Related Tools
JSON Formatter & Validator
PopularValidate JSON, pretty-print it, minify it, and inspect JSON paths.
Text Difference Checker
Compare two texts and find line-by-line changes.
Base64 Encode / Decode
PopularConvert plain text and Base64 in either direction.
SHA Hash Generator
Generate SHA-2 hashes for text and files locally.