CSV ↔ Excel Converter
Convert between CSV and Excel formats locally in your browser.

Click or drag and drop your CSV file

Comma-separated values (.csv, .tsv, .txt)

Utilities

CSV ↔ Excel Converter

Convert between CSV and Excel (.xlsx) formats with a toggle.

CSV ↔ Excel Converter translates between comma-separated text and .xlsx workbooks with a direction toggle, entirely on-device. The page's own Info Alert says it: "Conversion runs entirely in your browser. No files are uploaded." Flip between "CSV → Excel" and "Excel → CSV", drop a file into the mode-aware dropzone (accept .csv/.tsv/.txt or .xlsx/.xls), preview the first 20 rows with "{mb} MB · {cols} columns × {rows} rows" metadata, then "Convert to {Excel|CSV}" behind a 10→30→90→100% progress bar.

CSV→Excel parses with Papa Parse, builds a worksheet via XLSX.utils.json_to_sheet, and writes a Sheet1 workbook as a spreadsheetml Blob; Excel→CSV reads the workbook's first sheet with XLSX.read and exports sheet_to_csv as text/csv. The xlsx package is dynamically imported to keep the initial bundle light. Download saves basename.xlsx or basename.csv; "Start Over" clears everything. SheetJS and Papa both run in-tab — zero network.

How it works

lib/csvExcelConverter.ts implements both directions. CSV→Excel: Papa parse (header, skipEmptyLines) → XLSX.utils.json_to_sheet → book_new / book_append_sheet('Sheet1') → XLSX.write({ bookType: 'xlsx', type: 'array' }) → Blob of application/vnd.openxmlformats-officedocument.spreadsheetml.sheet. Excel→CSV: XLSX.read(arrayBuffer) → SheetNames[0] → sheet_to_csv → text/csv Blob. Output name = original basename + the target extension.

A preview is built on file select (Papa or sheet_to_json header:1) and always capped at 20 rows with a "Showing 20 of {n} rows" footnote. State (file, mode, resultBlobUrl, previewData) lives in csvExcelConverterSlice; xlsx is code-split via await import('xlsx'). The "Local Processing" Alert documents the no-upload guarantee — all libraries run in the browser.

How to use

  1. Step "Upload" — choose direction via the "CSV → Excel" / "Excel → CSV" toggle.
  2. Drag or click the dropzone ("Drop your … file here"); accept types follow the mode.
  3. Preview renders (first 20 rows) with "{cols} columns × {rows} rows" metadata.
  4. Optionally "Remove" the file to restart.
  5. Click "Convert to {Excel|CSV}" — progress bar shows 10→30→90→100% while "Converting...".
  6. Toast "Conversion complete!"; step moves to "Download".
  7. Excel→CSV shows a "CSV Preview (first 20 rows)" table; CSV→Excel shows the result card "Converted to EXCEL".
  8. "Download .xlsx"/".csv" saves; "Start Over" clears everything.

Tips

  • The "Local Processing" alert documents that no upload occurs — SheetJS/Papa run in-tab.
  • Excel→CSV uses only the first sheet (SheetNames[0]) — multi-sheet workbooks export their first tab alone.
  • Preview always caps at 20 rows with a "Showing 20 of {n} rows" footnote, regardless of file size.
  • xlsx is code-split (await import('xlsx')) so the rest of the app doesn't pay for SheetJS on initial load.
  • Accept types change with the mode: .csv/.tsv/.txt for CSV input, .xlsx/.xls for Excel input.

CSV ↔ Excel Converter FAQ

Is the file uploaded?

No — the Info Alert states "Conversion runs entirely in your browser. No files are uploaded."

Which Excel versions are accepted?

The dropzone accepts .xlsx and .xls, read via SheetJS XLSX.read.

Are multiple sheets converted?

No — Excel→CSV converts only the first sheet (SheetNames[0]).

What errors can occur?

"Failed to parse file." on preview failure; "Conversion failed." if the conversion itself throws.

Which libraries are used?

SheetJS (xlsx) for workbook read/write and Papa Parse for CSV parsing — both running locally in the browser.

Credits

  • SheetJS (xlsx) — Workbook read/write in lib/csvExcelConverter.ts and page preview — runs locally
  • Papa Parse — CSV parsing for CSV→Excel and preview — runs locally
ShareTweet
More Utilities

Command Palette

Search for a command to run...