2 min read
By HappyCSV Team

Batch Convert Multiple Excel Files to CSV

How to convert 100 Excel files to CSV at once. Use VBA macros, Python scripts, or batch converters to save hours of manual work.

Batch Convert Multiple Excel Files to CSV

You have a folder with 500 .xlsx files. You need them all as .csv files for a database import.

Opening and saving each one manually would take hours. Let's do it in seconds.

Method 1: VBA Macro (Windows Only)

You can run a macro inside Excel to process a whole folder.

  1. Open a blank Excel file.
  2. Alt+F11 (VBA Editor).
  3. Insert > Module.
  4. Paste this:
Sub BatchConvertToCSV()
    Dim strFile As String
    Dim strPath As String
    Dim wbk As Workbook

    ' Change this to your folder path (end with backslash)
    strPath = "C:\MyFiles\"
    strFile = Dir(strPath & "*.xlsx")

    Do While strFile <> ""
        Set wbk = Workbooks.Open(strPath & strFile)
        ' Save as CSV
        wbk.SaveAs Filename:=strPath & Replace(strFile, ".xlsx", ".csv"), FileFormat:=xlCSV
        wbk.Close SaveChanges:=False
        strFile = Dir
    Loop
End Sub
  1. Run it. Watch the screen flash as it processes everything.

Method 2: Python (Cross-Platform)

The best way. Works on Mac, Windows, Linux.

import pandas as pd
import glob
import os

# Get all Excel files
files = glob.glob("*.xlsx")

for file in files:
    # Read Excel
    df = pd.read_excel(file)

    # Create new filename
    new_name = file.replace('.xlsx', '.csv')

    # Save as CSV
    df.to_csv(new_name, index=False)
    print(f"Converted {file} to {new_name}")

Pros:

  • No Excel license needed (if using Python).
  • Very fast.
  • Can run in background.

Method 3: Mac Automator (macOS Only)

Mac has a built-in automation tool.

  1. Open Automator.
  2. Create a new Application.
  3. Search for "Convert Format of Excel Files" (requires Excel installed).
  4. Drag it to the workflow.
  5. Change "Convert to" -> CSV.
  6. Save the app as "Excel to CSV Droplet".
  7. Drag and drop your 500 files onto this new app icon. It will process them all.

Method 4: LibreOffice (Command Line)

If you don't have Excel but have LibreOffice (free).

soffice --headless --convert-to csv *.xlsx

This command converts every Excel file in the folder to CSV without opening the GUI.

Summary

  • Windows: Use VBA.
  • Mac: Use Automator.
  • Developer: Use Python or LibreOffice.
  • Manual: Don't do it.

Converting files? HappyCSV supports batch processing to convert your data formats instantly.

Need to handle CSV files?

HappyCSV is the free, secure way to merge, split, and clean your data — all in your browser.