paste in · array of objects out

CSV to JSON Converter — the delimiter, worked out

Paste a CSV and get a JSON array of objects, ready for an API, an app, or a NoSQL database. The delimiter and the header row are worked out for you. No upload, no sign-up.

Converter — Ready
Awaiting input
idle — paste CSV and the objects show up here
0 records 0 columns Auto delimiter
runs entirely in your browser
nothing is uploaded, ever
no sign-up, no account
free — no paid tier, ever
The basics

What is a CSV to JSON converter?

A CSV to JSON converter takes tabular data — rows and columns from a spreadsheet or CSV file — and turns it into a JSON array of objects. Each row becomes one object. The first row, by convention, is the header: it provides the keys that every object will use. Subsequent rows provide the values.

For example, this CSV:

name,role,city
Alice,Engineer,New York
Bob,Designer,London

becomes this JSON:

[
  { "name": "Alice", "role": "Engineer", "city": "New York" },
  { "name": "Bob", "role": "Designer", "city": "London" }
]

This is the most common shape used by web APIs and JavaScript applications. The conversion is lossless for any data that fits in a table — every column becomes a key, every cell becomes a value. The only thing you lose going CSV → JSON is implicit type information (Excel's cell formats), but HopConvert infers sensible JSON types where it can: numbers, booleans, and null values are detected and emitted as proper JSON types, not strings.

Step by step

How to convert CSV to JSON in 3 steps

Most conversions take less than a minute. No login, no upload to a server, no installation.

  1. Paste or upload

    Drop a .csv file into the upload zone, or paste CSV text. The converter auto-detects the delimiter (comma, tab, semicolon, or pipe) from the first line.

  2. Preview

    The live preview shows the JSON output as you type. Open the settings cog to set the delimiter manually, change header behaviour, or switch between pretty and minified output.

  3. Copy or download

    Click Copy JSON to put the result on your clipboard, or Download JSON to save a .json file. Drop it straight into your app, API, or MongoDB.

Why HopConvert

Built for the messy CSV you actually have

Real-world CSV has quirks: quoted commas, mixed delimiters, missing headers, BOM markers. HopConvert handles them all.

Auto-detect delimiter

Sniffs the first line and picks the most likely delimiter. Manual override available in settings for tricky files.

Header row handling

First row is used as keys by default. Toggle off for files without a header, or supply custom column names.

Type inference

Numbers, booleans, and null values are auto-detected and emitted as proper JSON types. No more "42" as a string.

Browser-only privacy

Every byte is processed in your browser using JavaScript. Nothing is uploaded, logged, or stored on our servers.

RFC 4180 compliant

Handles quoted values, embedded quotes (""), newlines inside cells, and BOM markers correctly. Same parser as the big libraries.

Pretty or minified

Pick pretty-printed for human reading or minified for production. One click in the settings cog.

Comparison

CSV vs JSON: what's the difference?

Both store data, but they're designed for very different jobs.

AspectCSVJSON
StructureFlat tabular (rows and columns)Hierarchical (nested objects, arrays)
Best forSpreadsheets, BI tools, human analysis, databasesAPIs, web apps, configuration, machine-to-machine
File sizeSmaller (compact plain text)Larger (more syntax overhead)
Human readabilityHigh (opens directly in Excel)Moderate (requires understanding of syntax)
Type systemAll cells are text (types inferred by application)Native types: string, number, boolean, null, object, array
Nested dataRequires flatteningNative support
EditingEasy in Excel or any text editorNeeds a JSON-aware editor or formatter
Use cases

When teams reach for CSV to JSON

The reverse direction is just as important as JSON to CSV. Here are the most common reasons to convert a spreadsheet into structured data.

API ingestion

Many REST APIs accept JSON for bulk operations. Convert a spreadsheet export into the exact JSON shape the API expects.

MongoDB import

MongoDB's native import format is JSON. Run mongoimport against the converted file to populate a collection in seconds.

Frontend data binding

JavaScript apps consume JSON natively. Convert a product catalog or user list and use it directly in a React, Vue, or Svelte component.

Static site data

Jekyll, Hugo, and Astro sites can use JSON data files at build time. Edit in Google Sheets, export as CSV, convert to JSON, drop in.

NoSQL database seed

Need to seed a Firestore, DynamoDB, or CouchDB collection? JSON is the universal interchange format.

Configuration generation

Convert a parameter list maintained in a spreadsheet into a JSON config file your app reads at startup.

The complete guide

CSV to JSON: the complete guide

Everything you need to know about the CSV format, the JSON output shape, and how to handle real-world edge cases.

Read the full CSV to JSON guide

What shape is the output?

By default, HopConvert produces a JSON array of objects. The first row of your CSV (or the first row you mark as the header) becomes the keys; each subsequent row becomes one object in the array. This is the shape that JSON.parse in JavaScript, json.load in Python, and JSONArray in Java all expect.

If you want a single object instead of an array — useful when your CSV has only one meaningful record — open the settings and switch to "Single object (key = first column, value = rest)". This is rare but supported.

You can also choose the indent style. Pretty-printed output uses 2 spaces and is easy to read; minified output is a single line and is what you want for production use or network transfer.

How are types inferred?

CSV has no native types — every cell is text. But the converter examines each value and emits the most appropriate JSON type:

  • Numbers: Any value matching the regex /^-?\d+(\.\d+)?$/ (integers and decimals, including negative) is emitted as a JSON number. Scientific notation (1.5e10) is also supported.
  • Booleans: true, false, TRUE, FALSE, Yes, No (case-insensitive) become JSON booleans.
  • Null: Empty cells and the literal string null, NULL, or N/A become JSON null.
  • Everything else: Strings. If the value contains a comma, quote, or newline, it is wrapped in JSON double quotes (escaping inner quotes as \").

If you'd rather treat all values as strings (e.g., zip codes that look like numbers, IDs that look like booleans), open settings and disable type inference.

How does quoting work?

CSV quoting is the source of most parser bugs in the wild. HopConvert implements RFC 4180 strictly, which means:

  • Any field may be wrapped in double quotes. "hello, world" is one field, not two.
  • Embedded double quotes are escaped by doubling them: "she said ""hi""" is a field whose value is she said "hi".
  • Newlines inside quoted fields are preserved, not treated as row terminators.
  • Unquoted fields stop at the delimiter (or the end of the line).

Files exported from Excel, Google Sheets, Numbers, and most databases all follow these rules. Files exported from some homegrown tools don't — if your input has weird quoting, you'll see an explicit error message rather than silent data corruption.

Which delimiter should I use?

The "right" delimiter depends on where your CSV came from:

  • Comma (default): Standard CSV. Used by most US exports, RFC 4180 examples, and most APIs.
  • Tab: Common for database exports and Excel paste operations. Avoids the comma-in-value problem entirely.
  • Semicolon: Default in many European locales, where the decimal separator is a comma and CSV would otherwise be ambiguous.
  • Pipe: Used by some log formats and pipe-separated value (PSV) tools. Useful when your data contains all the other common delimiters.

The auto-detect option sniffs the first line and picks the most likely delimiter based on which character appears most consistently as a separator. It works for >95% of real-world files. For trickier cases, set the delimiter manually in settings.

How are headers handled?

By default, the first row of your CSV is treated as the header — the names used as JSON keys. This matches what every spreadsheet program does on export.

If your file does not have a header row (some database dumps don't), open settings and either:

  • Turn on "Auto-generate columns" — the converter will use col1, col2, col3 as the keys.
  • Enter custom column names — one per line in the settings panel.

You can also strip whitespace from header names and lowercase them with one toggle — useful when you're feeding the output into a JavaScript app that uses camelCase keys.

Common edge cases

Real-world CSV is rarely as clean as the textbook example. Here are the most common gotchas and how HopConvert handles them:

  • UTF-8 BOM: The byte-order mark (the invisible \ufeff at the start of files saved by Excel on Windows) is automatically detected and stripped.
  • Trailing empty rows: Common in Excel exports. HopConvert ignores empty lines at the end of the file.
  • Embedded newlines: Supported via quoting. A field can contain a real newline if it's wrapped in double quotes.
  • Mixed line endings: Both CRLF (Windows) and LF (Unix) line endings parse correctly, even in the same file.
  • Different number of columns per row: The header row's column count is authoritative. Rows with fewer columns are padded; rows with more have extras dropped (with a warning in the result panel).
  • Duplicate column names: Auto-disambiguated as name, name_2, name_3.
  • Empty file or only headers: Returns an empty array [], not an error.

Performance and limits

Because HopConvert runs entirely in your browser, the practical limit is your tab's available memory — typically 200 MB to 2 GB depending on the browser and device. A 50 MB CSV is a few-second conversion; a 200 MB CSV is borderline.

For very large files, the bottleneck is usually memory, not CPU. Close other tabs, use a 64-bit browser (Chrome, Edge, Firefox all qualify), and avoid running on a low-RAM device. The converter streams the file in chunks rather than loading the whole thing at once, so it stays responsive even on large inputs.

Tools for this job

The same job, the way you need it

Free tools for the specific version of this conversion you are actually doing.

CSV to JSON type inference

Exactly how numbers, booleans and nulls are detected - and why leading zeros stay text.

FAQ

Frequently asked questions

Everything you need to know about converting CSV to JSON with HopConvert.

What is a CSV to JSON converter?
A CSV to JSON converter transforms tabular CSV data into a JSON array of objects. Each row becomes one object, with the header row supplying the keys. The result is a standard JSON document you can use in any web app, API, or NoSQL database.
Is HopConvert free to use?
Yes. The CSV to JSON converter is 100% free with no sign-up required. There are no paid tiers, no feature gates, and no premium plans. Conversion runs in your browser so we don't pay for servers and we don't charge you.
Does the first row need to be a header?
By default yes — the first row of your CSV is treated as the field names. If your file does not have a header row, open settings and switch to "auto-generate columns" (col1, col2, col3…) or provide custom column names.
Which delimiters are supported?
Comma, tab, semicolon, and pipe. The auto-detect option sniffs the first line of your file and picks the most likely delimiter. This works well for most spreadsheets and database exports.
How are quoted values handled?
RFC 4180 quoting is fully supported. Values wrapped in double quotes, embedded quotes escaped as two double quotes, and newlines inside quoted values all parse correctly. Numeric values are output as JSON numbers; everything else as JSON strings.
What output format options are there?
Pretty-printed (2-space indent, easy to read) or minified (single line, smallest file size). Pick pretty for human inspection and minified for production use or network transfer.
Can I convert large CSV files?
Yes. Because conversion happens in your browser, the practical limit is your tab's available memory (typically 200 MB to 2 GB). For very large files we recommend Chrome or Edge with a 64-bit browser and closing other tabs.
Does my data leave my browser?
No. All parsing and conversion happens client-side in JavaScript. Your CSV is never transmitted to a server. The page uses HTTPS and runs no third-party tracking scripts during conversion.
Can I open the resulting JSON in an API or app?
Yes. The output is a standard JSON array of objects that any web framework, REST client, or NoSQL database can read. For MongoDB, the array can be imported directly with mongoimport.
What if my CSV has different numbers of columns per row?
The converter uses the header row's column count as the authoritative source. Rows with fewer columns are padded with empty strings; rows with more columns have the extra values dropped (a warning is shown in the result panel).

Turn your CSV into an array

Free, instant, and private — your CSV never leaves this tab.

Start Converting Read the FAQ