Home › Guides › All sheets to CSV
How to convert every sheet in an Excel file to CSV
Excel saves one sheet at a time. Here are four ways to turn every sheet of a workbook into its own CSV: in the browser, with a macro, with Python, or with LibreOffice.
A CSV file holds a single table, so a workbook with five sheets becomes five CSV files. Excel and Google Sheets both save one sheet at a time. Here are four ways to convert every sheet at once, from one click to one command.
1. In your browser, in one click
- Open xlsxtocsv.com and drop your .xlsx file onto the converter.
- Check the sheets in the preview tabs. Hidden sheets are left out unless you check Include hidden sheets.
- Click Download all sheets (.zip). Each sheet becomes a CSV named after it, for example
Orders.csvandProducts.csv.
You can add several workbooks at once. The zip then has a folder for each workbook. Everything happens on your computer, and no file is uploaded.
2. In Excel, with a macro
This VBA macro saves each visible sheet of the open workbook as its own UTF-8 CSV, in the same folder as the workbook. Press Alt+F11, click Insert › Module, paste it, and press F5.
Sub SaveEverySheetAsCSV()
Dim wb As Workbook, ws As Worksheet, folder As String, n As Long
Set wb = ActiveWorkbook
If wb.Path = "" Then MsgBox "Save the workbook first.": Exit Sub
folder = wb.Path & Application.PathSeparator
Application.ScreenUpdating = False
Application.DisplayAlerts = False
For Each ws In wb.Worksheets
If ws.Visible = xlSheetVisible Then
ws.Copy
ActiveWorkbook.SaveAs Filename:=folder & ws.Name & ".csv", FileFormat:=xlCSVUTF8
ActiveWorkbook.Close SaveChanges:=False
n = n + 1
End If
Next ws
Application.DisplayAlerts = True
Application.ScreenUpdating = True
MsgBox "Saved " & n & " CSV files to " & folder
End Sub
Save the workbook before running it. The macro overwrites CSV files with the same names without asking. There's more detail in our Excel guide.
3. With Python and pandas
If you work with data in Python, pandas reads every sheet in one call. Install the libraries once with pip install pandas openpyxl, then run:
import pandas as pd
sheets = pd.read_excel("workbook.xlsx", sheet_name=None, header=None, dtype=str)
for name, df in sheets.items():
df.to_csv(f"{name}.csv", index=False, header=False, encoding="utf-8-sig")
sheet_name=None loads all sheets into a dictionary. header=None and header=False copy the rows exactly, with no extra header line. utf-8-sig adds a BOM so Excel opens the files cleanly.
One difference from Excel: pandas reads the stored values, not what the cell displays. A ZIP code stored as the number 501 with a 00000 format comes out as 501, and dates come out as 2026-03-04 00:00:00. If you need the values as displayed, use one of the other methods. Sheet names containing / or \ also need cleaning before they can be file names.
4. From the command line with LibreOffice
LibreOffice is free for Windows, Mac and Linux, and version 7.2 or later can export every sheet from the command line:
soffice --headless --convert-to "csv:Text - txt - csv (StarCalc):44,34,76,1,,0,false,true,true,false,false,-1" workbook.xlsx
This writes one file per sheet, named workbook-SheetName.csv. The numbers after the colon set the options: 44 is a comma separator, 34 a double quote around text, 76 UTF-8, the true in ninth place saves values as shown, and the final -1 means "all sheets". On Windows, the program is usually at "C:\Program Files\LibreOffice\program\soffice.exe". Close any open LibreOffice windows first, or the command may do nothing.
Which method should you use?
| Method | Best for | Values |
|---|---|---|
| xlsxtocsv.com | Anyone, any computer, private files | As shown in Excel |
| Excel macro | People who live in Excel | As shown in Excel |
| Python / pandas | Data pipelines and scripts | Raw stored values |
| LibreOffice command | Batch jobs on servers | As shown |
Skip the steps: convert every sheet to CSV in your browser, free.
Convert XLSX to CSV