CSV ↔ JSON Converter — Tutorial
What are CSV and JSON?
CSV (Comma-Separated Values)
CSV is a simple text format for storing tabular data. Each line represents a row, and columns are separated by commas. The first row often contains column headers.
Example:
name,age,city
John,30,New York
Alice,25,San Francisco
JSON (JavaScript Object Notation)
JSON is a structured format for representing data as objects and arrays. It's widely used for APIs, configuration files, and data exchange between applications.
Example:
[
{"name": "John", "age": 30, "city": "New York"},
{"name": "Alice", "age": 25, "city": "San Francisco"}
]
When to use each format
- CSV: Spreadsheet applications, data analysis, simple imports/exports
- JSON: Web APIs, configuration files, NoSQL databases, JavaScript applications
Official documentation
How to use the CSV↔JSON Converter
- Select conversion mode — Choose CSV→JSON or JSON→CSV from the dropdown.
- Text input — Paste or type CSV or JSON, then click Convert to get the result.
- File input — Drop or select a file. The tool will read and convert the file contents locally.
- Output actions — Copy the result or download it as a text file.
- History — Last 5 conversions are stored locally. Use Clear history to remove them.
Open the tool: CSV ↔ JSON Converter
Privacy & limits
- All conversions are performed locally in your browser; no data is uploaded.
- Max file size: 10 MB.
Troubleshooting
- Invalid CSV format: Check for missing quotes around fields containing commas, newlines, or quotes. Example:
"Smith, John",30 - Invalid JSON format: Ensure proper syntax - quoted keys, trailing commas removed, proper brackets.
- JSON→CSV requires array: Input must be an array of objects like
[{"key":"value"}, {"key":"value"}] - Mixed data types: CSV can only represent text. Complex JSON objects/arrays will be converted to strings.
- Large files: Processing very large files (>1MB) may slow down the browser significantly.
- Character encoding: Ensure your file uses UTF-8 encoding for special characters.
Common CSV parsing issues
- Commas in data: Wrap fields in quotes:
"Last, First",Age - Quotes in data: Escape with double quotes:
"He said ""Hello""" - Different separators: Some CSVs use semicolons or tabs - may need manual conversion
- Missing headers: Our tool expects the first row to be column headers
JSON structure requirements
- For CSV conversion: Must be an array of objects with consistent keys
- Nested objects: Will be flattened or converted to JSON strings
- Arrays within objects: Will be converted to comma-separated strings
- Null values: Converted to empty CSV cells
Best practices
- Preview first: For large files, test with a small sample first
- Backup your data: Always keep a backup of original files
- Validate output: Check the converted data for accuracy
- Consider data types: CSV loses type information (numbers become text)