CSV to JSON Converter

Convert CSV files or pasted data to a JSON array instantly. Supports quoted fields, custom delimiters and pretty-print output. Free, browser-based.

💻 Developer Tools Free Browser-based
Tool

What Is a CSV to JSON Converter?

A CSV to JSON converter reads delimiter-separated text — the format produced by spreadsheet applications like Excel, Google Sheets and LibreOffice Calc — and transforms it into a JSON array that JavaScript, Python, APIs and databases can consume directly. Instead of manually writing code to parse columns and rows, paste your CSV and get structured JSON in one click.

How the Conversion Works

When First row is header is enabled, each subsequent row becomes a JSON object whose keys come from the header row: [{"name":"Alice","age":"30"}]. Without headers, each row becomes a flat array of values: [["Alice","30"]]. Quoted fields, fields containing the delimiter, and doubled-quote escapes are all handled correctly per RFC 4180.

Supported Delimiters

DelimiterSymbolCommon Source
Comma,Excel, Google Sheets, standard CSV exports
Semicolon;European locale Excel exports (decimal comma regions)
Tab\tTSV files, cells copied directly from a spreadsheet
Pipe|SQL dumps, custom data exports, log files

Output Options

  • 2 spaces — readable indented JSON, good for pasting into config files or code.
  • 4 spaces — broader indentation preferred in some Python and Java projects.
  • Minified — single-line compact JSON with no whitespace, smallest possible output for API payloads.

Common Use Cases

  • Converting spreadsheet exports to JSON for REST API requests or database inserts.
  • Transforming sales or analytics reports into structured data for JavaScript applications.
  • Preparing CSV data for upload to NoSQL databases like MongoDB or Firestore.
  • Moving data between tools that speak different formats without writing any code.

Why CSV Values Come Out as Strings

CSV is a text-only format with no type information — every value is technically a string. When this converter produces JSON, numbers like 42 and booleans like true remain wrapped in quotes ("42", "true") to faithfully represent the CSV source without making assumptions. To cast specific columns to their correct types, post-process the output in JavaScript with a JSON.parse reviver function, or run jq on the command line to convert specific keys. If you need the reverse operation — turning JSON back into CSV — use the JSON to CSV Converter.

'All values come out as strings — how do I get numbers?', 'a' => 'CSV has no type information, so all values are strings by default. Post-process the JSON output with JSON.parse using a reviver function, or use jq (.[] |= with_entries(.value |= tonumber)) to cast specific columns to numbers.'], ['q' => 'Can I convert a .csv file instead of pasting?', 'a' => 'Open your CSV file in any text editor (Notepad, TextEdit, VS Code), select all, copy and paste it into the input box. The converter processes the text — it does not need the file directly.'], ['q' => 'How do I handle CSV files with no header row?', 'a' => 'Uncheck the "First row is header" option. Each row will be converted to an array of values rather than a named object, giving you output like [["Alice","30"],["Bob","25"]].'], ['q' => 'What if my CSV uses a different encoding like UTF-16?', 'a' => 'Open the file in a text editor that supports encoding conversion (VS Code, Notepad++) and re-save it as UTF-8 first. Then paste the UTF-8 text into this converter — all standard characters and accented letters will be preserved.'], ]" />