CSV to JSON and JSON to CSV Converter

Convert CSV rows to JSON objects or flat JSON records to CSV. Preserve text values and export structured files directly in your browser.

Loading tool...

Processing happens locally in your browser. Your input is not uploaded to a processing server.

Move tabular records between CSV and JSON

CSV and JSON often describe the same business information in different forms. A spreadsheet export might contain one customer per row, while a web application expects an array of objects with named properties. Converting between them is useful for a small data import, a prototype, a report handoff, or an API test. The essential task is preserving the meaning of the fields while changing the representation.

This converter treats the first CSV row as column names and creates one JSON object for each following row. In the other direction, it accepts a nonempty array of flat JSON objects and writes a header row followed by their values. It does not flatten nested documents automatically. An address object or a list of tags needs an intentional mapping before it can become a simple spreadsheet cell. Choosing that mapping is a data-design decision rather than a formatting detail.

Preserve identifiers and understand empty values

Values read from CSV remain strings. That protects identifiers such as postal codes, telephone numbers, and account references whose leading zeros could be lost through automatic numeric conversion. A value like 00125 may be an identifier rather than the number one hundred and twenty-five. If a receiving API requires numbers or booleans, apply an explicit type conversion with knowledge of the relevant field instead of relying on a general guess.

In a JSON-to-CSV conversion, a missing property or a null value becomes an empty cell. CSV does not have a universal built-in distinction between those states. The tool collects the property names across the supplied rows so that a field appearing later is not silently omitted from the header. Review the chosen column names before import. A database may consider two apparently similar labels different because of capitalization, leading spaces, or punctuation, even when a spreadsheet displays them comfortably.

Quoted fields and delimiters need real parsing

A comma inside a quoted description should stay inside one cell rather than create a new column. CSV can also contain quotation marks, embedded line breaks, and different delimiter conventions. This converter uses a dedicated CSV parser rather than splitting every line on commas. Automatic delimiter detection is convenient for ordinary files, and an explicit comma, semicolon, or tab selection is available when the source format is known.

Column names must be unique and nonempty, and data rows must match the header width. These checks prevent ambiguous object keys and accidental loss of cells. They do not prove that the underlying records are correct. A structurally valid file can still contain duplicate customers, impossible dates, or an amount in the wrong currency. Use a small representative test import and confirm the destination's business rules separately before processing a valuable collection of records.

Protect spreadsheet exports and verify the round trip

Spreadsheet programs may interpret cells beginning with certain characters as formulas. That is useful for a trusted calculation but dangerous when a CSV contains user-supplied text. Formula protection is enabled by default for CSV export and can add a leading apostrophe to risky cells. This makes the spreadsheet treatment safer, but it intentionally changes those exported cell strings. Document that choice if exact byte-for-byte data preservation matters to your workflow.

Before sharing a conversion, check records with commas, quotation marks, empty cells, and non-English text. Download the result and open it in the application that will receive it, because import settings can reinterpret a correctly generated file. A text editor is useful for inspecting raw JSON or CSV without automatic date and number formatting. Keep the original file, particularly when converting null values or protecting formulas, since a round trip may not recreate every original distinction. This tool is intended for manageable browser-sized data, not streaming a production database export.

Handle source text and exports carefully

Keep a copy of your original input before converting or reformatting it. A useful working pattern is to preserve the source, create a separate result, and compare a few representative records or paragraphs before passing the output to another application. Include unusual cases in that comparison: quotation marks, accented names, empty values, long lines, and punctuation often reveal problems that an ordinary sentence does not.

The text entered into this tool is processed in the browser. It is not submitted to a text-processing server by this tool, but that does not remove the usual responsibilities of working on a shared device. Clipboard contents may remain available after you leave the page, and downloaded files remain in the browser's download folder. Do not paste passwords or confidential customer records merely to try a sample operation.

Text formats describe structure, not trust. A document that parses successfully can still contain inaccurate information, a suspicious link, or content you do not have permission to publish. Review the result before using it in a spreadsheet, website, report, or production system. Where your workflow needs an audit trail, record the source filename, the transformation you applied, and the date outside the tool. Browser output is a working artifact, not a substitute for your organization's review process.

When testing an unfamiliar workflow, begin with a short, non-sensitive sample whose expected result you can explain. Include at least one awkward case instead of testing only simple words and numbers. Open a downloaded export in its destination application and check it there too. This small round-trip test is often more informative than trying a large private document first and discovering a format mismatch after sharing it.

Guide by . Report an issue or suggest a correction.

Frequently asked questions

Why are CSV numbers represented as JSON strings?

Automatic type inference can damage leading zeros and identifiers. Preserving values as text is the conservative default. Convert known numeric or boolean fields explicitly afterward when you understand the receiving system's schema and the meaning of those fields.

Can it convert nested JSON objects?

The JSON input must be an array of flat row objects. Nested objects and arrays are rejected rather than silently turned into unclear text. Decide which nested fields belong in columns and flatten the records before conversion.

Why did an apostrophe appear in my exported CSV?

Formula protection can prefix cells that a spreadsheet might execute as formulas. It is enabled by default to reduce that risk. Turn it off only when you trust the data and understand how the destination application will interpret the cells.

Related tools

Reference and further reading

RFC 4180's CSV format description provides background on the relevant format, technology, or requirements. External services have their own policies and may change independently of this page.