Home › Guides › Convert in Excel

How to convert XLSX to CSV in Excel

Step-by-step: save an Excel workbook as CSV on Windows, Mac and Excel for the web, which CSV type to choose, and a macro that saves every sheet.

Excel can save any workbook as a CSV file with Save As. It takes under a minute, but there are two catches: Excel saves only the sheet you're looking at, and it offers four kinds of CSV that behave differently. Here's how to get it right on Windows, Mac and the web.

Save an XLSX file as CSV in Excel for Windows

  1. Open the .xlsx file in Excel and click the tab of the sheet you want to convert. Only this sheet will be saved.
  2. Click File, then Save As. If your file is on OneDrive and AutoSave is on, the menu says Save a Copy instead.
  3. Choose a folder (click Browse if you don't see the one you want).
  4. Open the Save as type list and pick CSV UTF-8 (Comma delimited) (*.csv).
  5. Click Save. If the workbook has more than one sheet, Excel says it can save only the active sheet. Click OK.
  6. A yellow bar may warn that some features might be lost in the CSV format. That's expected: CSV has no formatting, formulas or extra sheets. Your original .xlsx file isn't changed.

Watch out: after saving, the window you're looking at is the CSV, not your workbook. Close it without saving again, and reopen the .xlsx if you want to keep working. Otherwise, your next edits go into the CSV, and they'll lose their formatting.

Which CSV type should you choose?

The four CSV choices in Excel's Save as type list, with CSV UTF-8 highlighted Save as type CSV UTF-8 (Comma delimited) (*.csv) PICK THIS CSV (Comma delimited) (*.csv)old encoding, can lose characters CSV (Macintosh) (*.csv)legacy, avoid CSV (MS-DOS) (*.csv)legacy, avoid
Excel lists four CSV types. CSV UTF-8 is the only one that keeps every character.

The four CSV options differ in encoding, the way characters are stored as bytes:

Excel's UTF-8 CSV starts with a byte order mark (BOM), which helps Excel open the file correctly later. A few strict importers choke on the BOM. If one does, our converter can write UTF-8 without it.

Excel for Mac

  1. Open the workbook and select the sheet you want.
  2. Click File › Save As.
  3. In File Format, choose CSV UTF-8 (Comma-delimited) (.csv).
  4. Click Save, and confirm when Excel says only the active sheet will be saved.

No Excel on your Mac? See how to convert XLSX to CSV on a Mac with Numbers, which is free.

Excel for the web

In Excel for the web (the free browser version that comes with a Microsoft account), open the workbook, then click File › Export › Download this sheet as CSV (.csv). Like the desktop app, it exports one sheet at a time.

Save every sheet as a CSV with a macro

Excel has no "all sheets" button. If you have many sheets, this short macro saves each visible sheet as its own CSV file next to the workbook, named after the sheet:

  1. Save the workbook first, so it has a folder to save next to.
  2. Press Alt+F11 to open the VBA editor, then click Insert › Module.
  3. Paste the code below, click inside it, and press F5 to run it.
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

It overwrites any CSV with the same name in that folder without asking. You don't need to save the macro afterward. If you close the editor and save the workbook as .xlsx, Excel drops the code, which is fine. If your Excel is older than 2016, change xlCSVUTF8 to xlCSV.

Or skip the macro: our converter turns every sheet into a CSV in one click, with no Excel needed.

What ends up in the CSV

Leading zeros, like those in ZIP codes, are saved correctly if they show in the cell. If they vanish when you reopen the CSV, that's Excel stripping them on the way in. Here's how to open a CSV without losing leading zeros or accents.

Skip the steps: convert every sheet to CSV in your browser, free.

Convert XLSX to CSV