Shard Tools

JSON to CSV Converter

Convert JSON objects to UTF-8 CSV in your browser.

Maintained by Roshan.

Browser-local data converter

Use JSON to CSV Converter

Columns follow the first appearance of each key. Missing values become empty cells, and nested values remain compact JSON.

Spreadsheet-safe stringsString cells beginning with =, +, -, or @ are prefixed with an apostrophe to prevent spreadsheet software from executing them as formulas.

During the latest release check, a JSON array was converted to a CSV blob in the browser and the downloaded output was verified as a file rather than just displayed text.

Explore developer and data tools

Find related browser-local tools for nearby tasks without starting another search.

Browse all developer and data tools

About JSON to CSV Converter

JSON represents nested application data well; CSV represents a rectangular table that spreadsheets and many import tools understand. Converting between them requires decisions that a filename change cannot make. This converter accepts one JSON object as a single row or an array of objects as multiple rows. It builds columns from every key encountered, keeps the first-seen column order, and leaves a cell empty when a later object does not contain that key. Commas, quotes, and line breaks are escaped correctly. Nested arrays and objects are retained as compact JSON inside one cell rather than silently discarded. The complete conversion and UTF-8 download happen locally in the browser.

Work through the input

  1. Provide either an object or an array whose items are objects. A top-level object becomes one CSV data row. A top-level array of strings or numbers is rejected because there is no reliable column name for each scalar. An empty array is also rejected instead of producing a misleading blank download.
  2. The converter scans rows in order and creates a union of their property names. If the first record contains name and email while the second also contains country, the output columns become name, email, country. The first record receives an empty country cell. This approach preserves sparse exports without requiring every source object to have identical keys.
  3. Each cell is converted to text. Null and missing values become empty cells, booleans and numbers keep their readable representation, and nested objects or arrays are serialized as compact JSON. A nested value is not flattened into dotted columns because automatic flattening can create collisions and ambiguous array behavior. A future flattening tool should make those rules explicit.
  4. CSV quoting follows the common double-quote convention: fields containing a comma, quote, carriage return, or line feed are enclosed in double quotes, and an internal quote is doubled. Rows use CRLF endings for broad spreadsheet compatibility. The downloaded file begins with a UTF-8 byte-order mark so applications that guess legacy encodings are more likely to display international names correctly.
  5. Before quoting, string cells beginning with equals, plus, minus, or at-sign are prefixed with an apostrophe. Spreadsheet programs may otherwise interpret attacker-controlled text as a formula when the CSV is opened. Numeric negative values remain numbers. The result panel reports how many string cells received this protection so the transformation is visible rather than hidden.

When json to csv converter is useful

Combining records with optional fields

An API export contains name and email on every customer, but company appears only on business accounts. The converter creates all three columns and emits an empty company cell for personal accounts instead of dropping the optional field from the whole file.

Opening untrusted survey answers

A free-text response starts with =WEBSERVICE(...). Opening an unprotected CSV could make a spreadsheet interpret it as a formula. This converter prefixes that string and reports one protected cell while leaving ordinary answers and negative numeric scores unchanged.

Check the output

Questions about JSON to CSV Converter

Can I convert a JSON array directly to CSV?

Yes, when every array item is an object. The objects may contain different keys; the converter unions those keys into columns and leaves missing cells empty. Arrays of primitive values are rejected because they do not provide meaningful column names.

How are nested objects and arrays handled?

They are serialized as compact JSON and quoted inside one CSV cell. The converter does not invent a flattening scheme or multiply rows automatically, because either choice can change the meaning of the source.

Why did the tool add an apostrophe before a value?

The original was a string beginning with a character commonly interpreted as a spreadsheet formula. The apostrophe neutralizes execution when the file is opened. The result panel counts every protected cell so you can review the change.

Is the JSON or generated CSV uploaded anywhere?

No. The parser, column discovery, escaping, preview, clipboard action, and downloadable Blob all run locally. This browser page does not send the JSON to the Edge Assisted MCP endpoint.

Will non-English text survive the download?

Yes. JavaScript strings are converted into a UTF-8 CSV download, and the file includes a UTF-8 marker for spreadsheet compatibility. The target application's font and import settings still determine how characters are displayed.

Related tools

JSON Formatter and Validator

Format, minify, and validate JSON locally in your browser. Inspect keys, values, nesting depth, and root type without sending private API data to a server.

JWT Decoder

Decode a JSON Web Token and inspect claims and expiry in your browser. Your token is never transmitted.

CSV to JSON Converter

Convert CSV to a JSON array locally. Parse quoted commas, embedded newlines, BOM files, duplicate headers, sparse rows, and optional safe value types.

JSON to XML

Turn JSON into well-formed XML in your browser, with escaping and element naming handled correctly.

XLSX to CSV

Convert an Excel .xlsx sheet to CSV in your browser. Dates stay dates, leading zeros survive, and the file never leaves your device.

CSV to XLSX

Turn CSV into a real .xlsx workbook in your browser. Leading zeros and long numbers survive, unlike opening the CSV in Excel directly.

JSON to SQL

Turn a JSON array into SQL INSERT statements in your browser, with quotes escaped correctly.

JSON to HTML Table

Turn a JSON array into a clean HTML table in your browser, with markup in the data escaped safely.

JSON to Markdown Table

Turn a JSON array into a Markdown table in your browser, with pipes escaped so columns stay intact.