Developer Tools
CSV & JSON Converter
Convert structured CSV and JSON data in either direction.
CSV & JSON Converter tool
Loading tool…
Jump to a section
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.
- For JSON to CSV, leave spreadsheet protection enabled when the result may be opened in spreadsheet software. Turn it off only when exact string preservation is more important and the output will be handled as plain data.
- 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. Property names must be non-empty, and a non-empty array must contain at least one named property to define CSV columns. Empty objects are supported alongside records with named properties, with missing values exported as empty cells. Nested objects and arrays are serialized as JSON text inside their CSV cell rather than flattened into invented columns.
Spreadsheet formula protection
Spreadsheet apps may interpret text beginning with =, +, -, or @ as a formula. The default protection prefixes those string cells and headers with an apostrophe before CSV quoting. Numeric JSON values, including negative numbers, remain numeric. Disable protection only when you need the original text unchanged and will not open the output in a spreadsheet app.
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.
Why does some CSV text start with an apostrophe?
Spreadsheet protection adds it to string cells that look like formulas. This reduces the chance that spreadsheet software executes pasted data as a formula. Turn the option off if you require exact raw text and will handle the CSV outside spreadsheet software.
Is my data uploaded?
No. CSV parsing, JSON parsing, and output generation happen locally in your browser.