Csv guides
CSV vs JSON vs Excel: which format should you use for your data?
Choose CSV, JSON, or Excel based on data shape, types, formulas, formatting, interoperability, automation, and the next person or system using it.
Reviewed and updated
Primary sources checked


Choose for the next operation
The best format is the one the next person or system can use without guessing. A compact developer export may be frustrating for an analyst, while a richly formatted workbook may be a poor source for automated version control.
| Need | Best starting format | Reason |
|---|---|---|
| One flat import table | CSV | Simple records and fields; accepted by many systems |
| API payload or configuration | JSON | Objects, arrays, primitive value types, and nesting |
| Human analysis and presentation | Excel XLSX | Sheets, formulas, cell types, filters, styles, and charts |
| Long-term system of record | Database or governed data format | Validation, constraints, querying, and change control |
Do not choose from the filename alone. Choose from the data shape, required fidelity, and receiving contract. CSV, JSON, and Excel can all carry a list of customers, but they preserve different information around that list.
Use CSV for a portable table
RFC 4180 documents the familiar model: records appear as lines, fields are separated by commas, and quoted fields can contain commas, quotation marks, or line breaks. A header row is common but not compulsory.
CSV works well for:
- a single rectangular table;
- database imports and exports;
- bulk product, contact, or transaction transfers;
- datasets that benefit from line-oriented review;
- workflows where the receiving system publishes a CSV template.
Its simplicity is also its limitation. CSV does not carry a standard schema describing column types, null values, units, date conventions, relationships, formulas, formatting, or validation rules. Delimiters vary in practice. Some files use tabs or semicolons, and text encoding must still be agreed.
A value such as 00123 may be a postal code, not the number 123. A 16-digit identifier may exceed a spreadsheet application’s safe numeric precision. A blank field may mean unknown, not applicable, zero, or an empty string. Document those meanings outside the raw file or in a separately governed schema.
When opening CSV in Excel, use the import controls instead of double-clicking a sensitive dataset. Microsoft’s current guidance explains that columns can be imported as text to preserve leading zeros. It also confirms that saving a workbook as CSV preserves only the active sheet and loses formatting.
Use JSON for structured application data
RFC 8259 defines JSON values as objects, arrays, numbers, strings, booleans, or null. This makes JSON a natural fit for APIs, configuration, event messages, fixtures, and application state.
JSON is stronger than CSV when records contain:
- nested addresses or settings;
- arrays such as tags or order lines;
- explicit booleans and nulls;
- objects with different optional fields;
- parent-child relationships that should remain together.
Consider an order with ten line items. CSV normally requires repeated order fields, a second related table, or a line-items field containing another serialization. JSON can keep an order object and its line-item array together.
JSON is not a spreadsheet. It has no native cell formatting, formulas, charts, comments, or date value type. Dates usually travel as agreed strings, so producers and consumers must define timezone and precision. Object member order should not carry business meaning.
Open CSV to JSON when a flat table needs to feed code. The first row becomes property names, so clean duplicate or blank headers first. Decide whether numeric-looking identifiers should remain strings. For nested source data, JSON to Excel can flatten keys into columns or preserve nested content as compact JSON text inside cells.
Use Excel when the workbook is part of the work
XLSX is an Office Open XML package standardized through ECMA-376. A workbook can carry multiple worksheets, cell types, formulas, styles, filters, charts, relationships, and other features that plain text formats cannot represent.
Choose Excel when people need to:
- calculate with formulas;
- sort and filter interactively;
- maintain several related sheets;
- apply number and date formats;
- present charts, conditional formatting, or print layouts;
- add controlled validation and reviewer-facing context.
Microsoft documents a worksheet maximum of 1,048,576 rows by 16,384 columns. Reaching a theoretical limit does not mean the workbook will be pleasant to use; memory, formulas, styles, and hardware matter. Large recurring data processing belongs in a database, query engine, or analytical system rather than a single workbook.
Excel’s features also create hidden meaning. A value may depend on a formula, another sheet, an external link, a macro, a locale-specific format, or a manually coloured cell. Exporting to CSV or JSON can preserve visible values while losing the rules that produced them.
Use CSV to Excel when a plain table needs a usable worksheet with headings, a frozen first row, and a filter. FileGizmo stores formula-triggering text safely in generated workbooks, but every exported file still deserves review.
Understand conversion loss before you convert
Conversion is a mapping, not a rename.
| Conversion | Usually preserved | Commonly lost or changed |
|---|---|---|
| Excel to CSV | Active-sheet displayed values | Other sheets, formulas, styles, charts, validation |
| CSV to JSON | Rows, headings, and field text | Original quoting style, delimiter choice, implicit type intent |
| JSON to CSV | Selected flat fields | Nesting, arrays, heterogeneous object shapes |
| CSV to Excel | Table values | Original schema intent unless types are deliberately assigned |
| JSON to Excel | Records and selected nested representation | Exact object structure when flattened |
Keep the source file and define what a successful conversion must preserve. Count rows, compare key columns, test non-ASCII text, and inspect the first and last records. Add checks for nulls, long identifiers, dates, decimal separators, embedded line breaks, and duplicate headings.
For the workbook-to-text path, use Excel to CSV and treat the source workbook’s own import and export warnings as part of the workflow.
Protect identifiers and untrusted fields
Spreadsheets may interpret cells beginning with characters such as =, +, -, or @ as formulas. OWASP documents this as CSV or formula injection when untrusted input becomes active spreadsheet content.
Do not “fix” the risk by silently deleting legitimate values. Define the consumer, sanitize at the export boundary, and preserve a raw governed copy. FileGizmo’s spreadsheet-producing workflows store formula-triggering input safely as text, but downstream software and manual edits can change that boundary.
Identifiers deserve a declared text type even when they contain only digits. This applies to postal codes, account numbers, phone numbers, tracking codes, card-like references, and values longer than common floating-point precision.
A practical decision checklist
Before choosing, answer:
- Is the data one table or a nested structure?
- Does the receiver require a particular format or template?
- Must formulas, formatting, multiple sheets, or charts survive?
- Are types explicit, or will the next tool infer them?
- How are nulls, dates, timezones, decimals, and identifiers represented?
- Does the file contain untrusted text that a spreadsheet could execute?
- Will people edit it, software parse it, or both?
- What row-count, schema, and spot checks prove the handoff worked?
Choose CSV for a plain interoperable table, JSON for structured machine data, and XLSX for a human-operated workbook. The TinyWow comparison discusses the wider trade-off between a broad server-backed catalogue and focused browser-local workflows. Format choice still depends on the receiving contract, not which converter has the longest tool list.
The FileGizmo way
Free tools. Never uploaded.
Good to know
Frequently asked questions
Is CSV or JSON better for an API?
JSON is usually the better fit because it represents objects, arrays, numbers, strings, booleans, and null. CSV suits an endpoint only when the contract is a flat rectangular table and its delimiter, encoding, headers, and null rules are explicit.
Is CSV smaller than Excel or JSON?
Often, but not always. CSV has little structural overhead, JSON repeats property names, and XLSX packages compressed XML plus workbook features. Compressibility, row shape, repeated values, and formatting determine the real result.
Does CSV preserve leading zeros and dates?
CSV stores text fields, but spreadsheet software may infer types when opening it. Import postal codes, account IDs, phone numbers, and long identifiers as text, and use an unambiguous documented date format.
Can FileGizmo preserve Excel formulas when converting to CSV?
No. Its Excel-to-CSV workflow exports the displayed worksheet data, not a reusable workbook model. CSV cannot preserve multiple sheets, formulas, cell formatting, charts, macros, or workbook relationships.
Primary references
- IETF RFC 4180, common CSV format, October 2005
- IETF RFC 8259, JSON data interchange format, December 2017
- Ecma International ECMA-376 Office Open XML standard, checked 25 July 2026
- Microsoft Excel specifications and limits, checked 25 July 2026
- Microsoft save a workbook in another format, checked 25 July 2026
- Microsoft import or export text and CSV files, checked 25 July 2026
- OWASP CSV Injection guidance, checked 25 July 2026
- FileGizmo security boundary