How CSV to JSON Conversion Works
CSV (Comma-Separated Values) and JSON (JavaScript Object Notation) are two of the most common data interchange formats. CSV is compact and spreadsheet-friendly; JSON is hierarchical and native to web APIs. This tool lets you move between them instantly, entirely in your browser.
The CSV Format (RFC 4180)
The official CSV spec (RFC 4180) defines these rules that this converter follows exactly:
- Fields are separated by a delimiter (default: comma). The auto-detect option checks your data and picks the right one.
- Fields containing the delimiter, double-quotes, or newlines must be enclosed in double-quotes.
- A double-quote inside a quoted field is represented by two consecutive double-quotes (
""). - The first row is typically a header row naming the columns.
- Rows are separated by CRLF or LF line endings — both work.
Type Inference
When type inference is enabled (the default), string values are automatically converted to native JSON types:
"42"→42(number)"3.14"→3.14(number)"true"/"false"→true/false(boolean)""or"null"→null- Everything else stays a string.
Turn off type inference when you need strict string output — for example, when a column of ZIP codes like 01234 should remain "01234", not 1234.
Dot-Notation Keys → Nested Objects
Enable Expand dot keys to turn a header like address.city into a nested JSON structure: {"address": {"city": "..."}}. This is useful when preparing data for a hierarchical API that expects nested objects.
JSON → CSV: Flattening Nested Objects
When converting JSON back to CSV, nested objects are automatically flattened using dot-notation keys. An object {"user": {"name": "Alice", "age": 30}} becomes two columns: user.name and user.age.
Keyboard Shortcuts
- Ctrl/Cmd+Enter — Convert now
- Ctrl/Cmd+D — Download output
- Ctrl/Cmd+Shift+C — Copy output
Common CSV Pitfalls
- Commas inside values: If your data contains commas (e.g., "Smith, John"), the field must be quoted. This converter handles this correctly per RFC 4180.
- Inconsistent column counts: Some exporters produce rows with missing trailing fields. This converter fills missing values with
nulland warns you which rows are affected. - BOM characters: Files exported from Excel sometimes start with a UTF-8 BOM (
). This converter strips it automatically. - Encoding: Upload files are read as UTF-8. If your CSV uses a different encoding (e.g., Latin-1), convert it to UTF-8 first.
- Large files: Files over 5 MB may slow the preview table. The converter will process them but limit the preview to the first 50 rows.
CSV vs JSON: When to Use Which
Use CSV when: sharing tabular data with non-technical users, importing into spreadsheets, working with large flat datasets where column names are stable.
Use JSON when: working with web APIs, storing hierarchical or nested data, using JavaScript/Node.js/Python scripts, or when values may contain commas or special characters.
Frequently Asked Questions
[{"name":"Alice","age":30}]. This is what most APIs and libraries expect. Array of arrays preserves raw rows: [["name","age"],["Alice","30"]], useful for data grids and matrix operations.