CSV to JSON and JSON to CSV Converter | Local and Loss-Aware

ConverterRuns in Your Browser (No Uploads)

Convert CSV rows to JSON or JSON records to CSV without uploading the source. Preserve text by default, handle quoted multiline cells, inspect renamed duplicate headers, flatten nested JSON, and protect spreadsheet formula cells.

What to do next

Continue with a related workflow or open the next tool that usually follows this task.

How to Use This Tool

Choose CSV to JSON or JSON to CSV before pasting data.

Select the comma, tab, semicolon, or pipe delimiter used by the CSV side.

For CSV input, choose header handling, whitespace rules, JSON formatting, and whether safe scalar types should be inferred.

For JSON input, choose nested-value handling, CSV headers, formula protection, and download BOM behavior.

Review the row, column, and warning counts, then inspect renamed headers, empty cells, nested values, and protected formulas.

Copy the current result or download it, then reopen the file in the destination app before importing the full dataset.

When to Use This Tool

Spreadsheet export to API fixture

Turn an Excel or Google Sheets export into JSON fixtures while preserving leading-zero IDs and quoted multiline notes.

API response review in a spreadsheet

Convert an API records array to a reviewable CSV with later-row fields, nested-value controls, and formula protection.

CSV import troubleshooting

Inspect duplicate headers, field-count mismatches, delimiter mistakes, and malformed quotes before a database or support import.

Private QA and support handoff

Prepare a small, reproducible CSV or JSON sample for a ticket without sending the source to a conversion service.

Common Mistakes

Inferring types before checking identifier columns

IDs, postal codes, and account numbers often need leading zeros. Keep type inference off unless the destination explicitly expects JSON numbers or booleans.

Treating every line break as a new CSV row

A comma or line break inside a value must be enclosed in CSV quotes. The parser respects valid quoted cells but reports an unclosed quote instead of guessing where a record ends.

Exporting nested JSON without choosing a mapping

CSV is flat. Choose Flatten for dotted nested columns or JSON text to keep each nested value in one cell, then inspect the reopened spreadsheet before importing it elsewhere.

Examples

Preserve spreadsheet text during CSV to JSON conversion

Quoted commas and multiline notes stay in one field, while leading-zero IDs remain JSON strings because type inference is off by default.

Input
id,name,note
0012,"Doe, Jane","line 1
line 2"
Output
[
  {
    "id": "0012",
    "name": "Doe, Jane",
    "note": "line 1\nline 2"
  }
]

Keep later JSON fields and protect formula cells

Headers are collected from every record, nested objects become dotted columns in Flatten mode, and formula-like text receives an apostrophe before CSV download.

Input
[{"id":1,"profile":{"city":"Seoul"},"note":"=2+2"},{"id":2,"active":true}]
Output
id,profile.city,note,active
1,Seoul,"'=2+2",
2,,,true

How loss-aware CSV and JSON conversion works

PapaParse reads CSV according to the selected delimiter and RFC-style quote rules, including escaped quotes and line breaks inside quoted cells. Empty physical lines are skipped, while rows with too few or too many fields are rejected.

When the first row is a header, surrounding header whitespace can be trimmed explicitly. Empty headers are rejected and duplicates receive stable suffixes with a visible warning so both source cells survive in JSON.

CSV cells remain strings by default. Optional inference recognizes lowercase true, false, null, and valid finite JSON numbers only when their decimal value is not lossy; leading-zero and risky numeric text stays quoted.

JSON input uses the shared strict parser and CSV serializer. Columns are discovered across all records, nested values use Flatten or JSON text mode, missing fields become empty cells, and formula protection is enabled by default.

Frequently Asked Questions

Is CSV or JSON uploaded to a conversion server?

No. Conversion stays in the current browser tab. A CSV or JSON source can be at most 5 MB, and independent guards cap records, fields, nesting depth, and generated output.

Which CSV delimiters can I select?

Comma, tab, semicolon, and pipe are supported as explicit one-character delimiters. Match the delimiter used by the source export before reviewing row and column counts.

How are CSV numbers and booleans represented in JSON?

CSV values remain strings by default, including leading-zero IDs. When safe type inference is enabled, exact JSON booleans, null, and lossless numbers are converted; risky numbers remain strings with a warning.

What happens to duplicate or empty CSV headers?

With a header row, duplicates are renamed deterministically and listed in a warning so no cell is silently overwritten. Empty headers and inconsistent field counts are rejected.

Which JSON shapes can be converted to CSV?

Use one object for one row or a non-empty array of objects for multiple rows. Flatten mode creates dotted object paths and stores arrays as JSON text; JSON text mode keeps each top-level nested value in one cell.

How does the CSV export reduce spreadsheet data risks?

Formula protection prefixes risky string cells and headers with an apostrophe. Keep it enabled for spreadsheet use, and reopen the downloaded file to verify long IDs, line breaks, non-English text, and later-row columns.

How This Tool Was Verified

Maintained and tested by Reviewed

Method: The CSV to JSON and JSON to CSV Converter check used the exact input from “CSV rows converted to JSON objects”. After “Choose the delimiter and header mode” and “Preserve cell text unless trimming is intentional”, we matched the resulting values or file against the documented output and inspected the risks described by “Ignoring commas inside quoted cells” and “Leaving spreadsheet formulas in exported rows”.

Expected result: The two CSV records became two JSON objects with string IDs and unchanged email and plan values; quoted delimiters stayed inside their source field.

Open the tested workflow

Related workflow guides

Use these focused guides when you need a practical workflow before opening the tool.

Workflow guide

Remove a BOM from a CSV or text file without re-encoding it

Use this workflow when an invisible leading signature changes the first CSV header or script token. Work from the original bytes, distinguish UTF-32 LE from its UTF-16 LE prefix, and do not remove UTF-16 or UTF-32 byte-order evidence until the destination is known.

Workflow guide

Detect a text file's encoding before import

Use the original file bytes to distinguish confirmed Unicode signatures from structural evidence and conservative heuristics. Then verify a candidate decoder against known headers and multilingual values before a full import.

Workflow guide

Convert CSV to JSON for spreadsheet data cleanup

Use this workflow when a spreadsheet export needs to become API-ready JSON, a fixture, or a reviewable dataset while preserving the text that the sheet actually contains.

Workflow guide

Fix CSV and JSON conversion errors

Use this workflow when a spreadsheet export, API fixture, or CSV/JSON handoff fails because columns shift, headers disappear, characters look broken, or JSON will not parse.

Workflow guide

Convert CSV or JSON to a Markdown table without corrupting data

A documentation table is reliable only when its source shape, conversion rules, and published rendering agree. This workflow starts with a scrubbed representative fixture, distinguishes quoted CSV from strict JSON object arrays, protects large numbers and nested values, checks every generated header and padded cell, and verifies the finished GFM with the exact renderer that will publish it.

Workflow guide

Format JSON for API debugging

Use this workflow when a compact response is hard to inspect, a fixture fails strict parsing, or a generic client error must be traced to an exact JSON location without confusing syntax with API-contract validity.

Workflow guide

Convert a JSON array to CSV for spreadsheets

Use this workflow when an API response, fixture, or exported JSON array needs to become a spreadsheet-friendly CSV table for review, sorting, filtering, or sharing.

Workflow guide

Generate UUID v4 fixtures without copying production IDs

Use this workflow to replace production identifiers with generated UUID v4 values while preserving each field's syntax and relationships. It covers schema mapping, browser-local batch generation, version and uniqueness checks, deterministic fixture storage, database constraints, and the security boundary between a record identifier and authorization.

Related Tools

Continue with another maintained workflow

Browse All Tools