For JSON to CSV, the command line is best for repeatable file-to-file automation, while an online browser converter is best for a quick, visible conversion.
The practical distinction is not automatically “local versus remote”: a command-line program runs without a browser, and a web tool can still process data in the tab. The decisive factors are input shape, repeatability, output policy, reviewability, and spreadsheet-formula safety.

Command-line and browser approaches side by side
A command-line route fits scripts, scheduled jobs, and data pipelines. A browser route fits one-off exploration, manual inspection, and spreadsheet preparation where setting up a script would add unnecessary work.
| Criterion | Command line | Browser converter |
|---|---|---|
| Best fit | Batch jobs, CI, and repeated file conversions | One-off conversions and visible review |
| Input | Reads a JSON file or standard input; fields come from the script | Paste a supported JSON array into a page |
| Output | Writes directly to a file; rules depend on the chosen library | Shows a preview and produces a downloadable CSV |
| Automation | Easy to rerun, parameterize, and test | The conversion itself is a manual browser step |
| Review | Inspect code and test representative records | Inspect the exact CSV text before saving |
| Privacy | Stays local unless the script or a dependency sends data elsewhere | Depends on the tool; this converter processes records in the tab |
| Formula safety | Must be implemented and tested separately | Always-on protection for risky strings and headers |
The strongest command-line advantage is repeatability: the same program can process batches, run in CI, or become one stage in a larger pipeline. The strongest browser advantage is a short path to a reviewable download without maintaining a script. The word “online” is not itself a privacy verdict. A web page can process locally, while a remote service can upload data, so the processing model matters more than the interface.
A command-line route for flat records
There is no single universal JSON-to-CSV executable. Tools such as jq, Python, and Node.js can perform the conversion, but each makes its own decisions about columns, missing values, nested data, escaping, and spreadsheet safety.
jq example for known, flat fields: jq -r '(["name","age"] | @csv), (.[] | [.name, .age] | @csv)' records.json > records.csv
This example writes a name-and-age header followed by one quoted CSV row per record. It deliberately names the fields, so it is not a general policy for union schemas, nested objects, or nested arrays. It also does not add the browser converter’s spreadsheet formula-protection prefix. Before using a command-line converter in production, define and test how it discovers columns, represents missing and null values, serializes nested structures, quotes fields, and handles values that could be interpreted as formulas. For sensitive records, review dependencies, temporary files, logs, and shell history as well as the conversion script.
Convert an object array with JSON To CSV
- Open JSON To CSV and paste a non-empty, top-level JSON array in which every row is an object. For example, [{"name":"Alice","age":30},{"name":"Bob","age":31}] has the supported shape. A top-level object, primitive, empty array, null row, array row, or primitive row is rejected with a specific message. Confirm that the pasted input remains within the visible limits.
- Convert the records, then review the preview before downloading it. Columns follow the order in which fields first appear while records are scanned from first to last, and later records can introduce additional columns. Check quoted fields, nested objects or arrays serialized inside a cell, and any reported formula-risk prefixes. The result summary reports how many cells received protection.
- Download converted.csv, then choose UTF-8 encoding and comma as the delimiter in the receiving application. The download uses the text/csv MIME type with UTF-8 charset. The preview contains the same complete CSV string placed in the local download, so it can be checked before saving.
Parsing, schema discovery, CSV escaping, preview generation, and Blob download creation all happen in the current browser tab. The JSON input, parsed records, CSV output, and download remain local and are not uploaded by the tool. That reduces upload exposure, but the resulting CSV should still be reviewed before it reaches a spreadsheet or another data-processing system.
Field rules that affect the result
The output follows common RFC 4180 field rules, but several conversion decisions are equally important when comparing JSON with CSV.
| JSON feature | CSV behavior |
|---|---|
| Column order | Fields are added in first-encounter order as parsed records are scanned from first to last. |
| Missing fields and null | Both become empty CSV cells. |
| Primitive values | False, true, zero, and other JSON primitive values retain their ordinary text forms. |
| Nested objects and arrays | They remain compact JSON inside one cell rather than becoming dotted columns; nested property order follows the parsed JavaScript object’s enumeration behavior. |
| CSV quoting | Fields containing a comma, double quote, carriage return, or line feed are enclosed in double quotes, and each internal double quote is doubled. |
| Layout and encoding | Commas separate fields, CRLF separates records, the download is UTF-8, and no UTF-8 BOM is added. |
| Whitespace and interpretation | The converter does not trim spaces, infer dates, localize numbers, or select a delimiter from the browser locale. |
| Formula-like strings | Protected field names and string values receive a leading apostrophe before CSV escaping. |
Formula protection is an intentional change to the exported text, not merely a display warning. It covers field names and JSON string values beginning with =, +, -, @, tab, or carriage return. It also catches a formula trigger preceded by ECMAScript-recognized whitespace, including a leading BOM or no-break space. A typed JSON number such as -42 remains -42 because it is numeric data rather than an attacker-controlled formula string.
The leading apostrophe is commonly interpreted by spreadsheet programs as a request to treat the content as text, but it is not a universal security guarantee. A downstream application may remove it, reinterpret the value, or apply different trigger rules. Review untrusted exports before opening them in software capable of executing formulas, commands, links, or external connections. OWASP’s CSV Injection guidance explains the broader risk. The converter provides no switch for disabling this default protection.
Nested cells are JSON text, not flattened columns. If the downstream process needs that structure, it must parse the cell as JSON rather than split it on commas or assume dotted field names.
Limits are enforced without silent truncation
The browser converter checks several independent boundaries before it can complete a conversion:
- Input: Up to 1,000,000 JavaScript characters.
- Rows: At most 10,000 records in the top-level array.
- Schema: At most 200 discovered columns.
- Output: At most 5,000,000 generated CSV characters.
Crossing any boundary returns an error and no shortened CSV. The text area continues to display over-limit input and marks it in the counter instead of cutting characters while the user types. Editing the JSON clears the previous CSV, error, and download URL. Converting again revokes the older download before creating a replacement, and a conversion error leaves no stale success visible. Leaving the page releases the remaining download URL.
Import the CSV in the receiving application
CSV has no universal encoding declaration or dialect marker, so the import settings must be selected deliberately rather than inferred by the file itself.
- Select converted.csv from the downloaded file and choose a delimited-text or CSV import path when the application offers one.
- Set the character encoding to UTF-8 and the delimiter to comma. Do not substitute semicolon, tab, or a locale-dependent delimiter for the converter’s fixed output.
- Review the imported column order, first row, nested JSON cells, and formula-protected values. Use an importer that honors quoted fields so commas inside a nested JSON value are not mistaken for column boundaries.
If the receiving application displays an apostrophe before a protected value, do not assume that every program will preserve it. Recheck the resulting text after import, especially when another application or transformation processes the file.
Keep JSON when structure or types matter
The Library of Congress description of CSV emphasizes its role as a tabular text format. CSV does not carry JSON data types, nested schemas, an internal character-encoding declaration, or a universal dialect marker. A value’s type, the difference between an empty field and a missing field, and the original boundary between text and structured data may therefore require additional context.
Use the command line for repeatable automation, a known schema, and integration with other pipeline stages. Use the browser converter for a controlled exchange, developer fixtures, small exports, spreadsheet preparation, or a quick conversion that needs an exact preview and local download. Keep the original JSON whenever types and structure matter, validate potentially incomplete source data first, and use a schema-aware pipeline for production migrations or regulated data.
Related reading: JSON to Excel API Alternative: Local XLSX Workflow.
Related reading: Convert JSON to Table Format: A Practical HTML Workflow.