You have a CSV file. You need it to be an XLSX file. Maybe a colleague or client needs it in Excel format. Maybe you want to add formatting, use multiple sheets, or apply formulas that you can save with the file. Maybe the system you are importing into only accepts XLSX.
Whatever the reason, this is one of the most common file conversion tasks in data work. And the first result on Google will be a website asking you to upload your file. Before you do that, consider: do you know where that data goes? Who stores it? For how long?
This guide covers every way to convert CSV to XLSX — all of them free, and most of them without sending your data anywhere.
Why convert CSV to XLSX?
CSV is a great format. It is simple, universal, and any tool can read it. But it has real limitations:
- No formatting. CSV is plain text. There is no way to bold a header, set column widths, apply number formatting, or color-code cells. When you share a CSV, the recipient gets raw data with no visual structure.
- Single sheet only. A CSV file is one table. If you need to deliver multiple related tables (summary + detail, data + documentation), you need separate files or a format that supports sheets.
- No formulas. CSV stores values, not formulas. If you want to include calculated columns that the recipient can modify, you need XLSX.
- No data types. Everything in a CSV is a string. A number, a date, and a text value all look the same. XLSX preserves type information, which means less ambiguity when the file is opened.
- Compatibility requirements. Some enterprise systems, import tools, and reporting platforms only accept XLSX. You may not have a choice.
That said, CSV has advantages too: it is smaller, it opens faster, and it works with every tool on every platform. If you do not specifically need the features that XLSX provides, keeping your data as CSV is usually the better option.
The privacy problem with online converters
Search for "CSV to XLSX converter" and you will find dozens of websites offering free conversion. The workflow is always the same: upload your file, wait, download the result. These tools work, but there is a cost that is not obvious.
When you upload a file to an online converter, your data passes through a third-party server. The converter's privacy policy may allow them to store your file, analyze it, or use it for training machine learning models. Even if the policy says they delete files after conversion, you are trusting a company you do not know with data that might include:
- Customer names, emails, and phone numbers
- Financial figures and transaction records
- Employee data and payroll information
- Medical or health-related records
- Proprietary business data
For public data or throwaway files, online converters are fine. For anything sensitive, use one of the offline methods below.
Method 1: Microsoft Excel
If you have Excel installed, this is the simplest path.
- Open Excel. Go to File → Open and select your CSV file. (Or right-click the CSV file and choose "Open with → Excel.")
- Excel will display the data in a worksheet. Check that columns are aligned correctly and data types look right.
- Go to File → Save As. In the "Save as type" dropdown, select Excel Workbook (*.xlsx).
- Choose your save location and click Save.
Watch out for data mangling. Excel aggressively auto-detects data types during CSV import. It will convert text like "1-3" to a date (January 3rd), truncate numbers longer than 15 digits, and strip leading zeros from values like "00123". If your data contains any of these patterns, use the Power Query import method instead:
- Go to Data → Get Data → From Text/CSV.
- Select your file. Power Query opens a preview.
- Click the column type indicator (the icon next to each column name) and set columns to "Text" where you want to prevent auto-conversion.
- Click Load. Then save as XLSX.
Limitations
Excel cannot convert CSV files with more than 1,048,576 rows. If your file exceeds this, Excel will silently truncate the data — you will get the first million rows and the rest will be lost without warning.
Method 2: LibreOffice Calc (free, cross-platform)
LibreOffice is free and available on Windows, macOS, and Linux. Its CSV import is actually better than Excel's because it gives you explicit control over column types.
- Open LibreOffice Calc. Go to File → Open and select your CSV file.
- An import dialog appears. Here you can set the delimiter, text encoding, and — critically — the data type for each column. Set columns to "Text" to prevent unwanted type conversion.
- Click OK. The data loads into a spreadsheet.
- Go to File → Save As. Select XLSX from the format dropdown. Click Save.
Pros: Free, no account, full control over import types, available on Linux.
Cons: Same row limit as Excel (1,048,576). Slower than Excel for very large files. The import dialog adds a step compared to double-click opening.
Method 3: Python (automation-friendly)
If you need to convert files regularly, or if your file is too large for a spreadsheet, Python gives you full control. The openpyxl library writes native XLSX files, and pandas makes the conversion a one-liner.
For more control over the output (formatting, multiple sheets, column widths), use openpyxl directly:
For batch conversion of multiple files:
Pros: Scriptable, handles large files, full control over formatting and types, no manual steps.
Cons: Requires Python installed. XLSX row limit still applies when creating XLSX files.
Method 4: Command line (ssconvert)
If you are on Linux or macOS and want a quick command-line conversion without writing Python, ssconvert (part of the Gnumeric spreadsheet package) does the job:
On macOS, you can install Gnumeric via Homebrew: brew install gnumeric.
Pros: One command, no GUI, easy to script, lightweight.
Cons: Requires installing Gnumeric. Limited formatting options. Not available on Windows natively.
Method 5: Viztab (browser, no upload)
Viztab lets you import a CSV and export it as XLSX entirely in your browser. No file upload, no server processing — the conversion happens locally using your browser's processing power.
Import your CSV
Drag and drop your file, or click to browse. Viztab auto-detects delimiters and encoding. Even large files load quickly.
Export as XLSX
Click the export button and choose XLSX. The file downloads directly — your data never leaves your browser.
The advantage of using Viztab for conversion is that you can also inspect and clean the data before exporting. Sort columns, filter out rows you do not need, fix values — then export the cleaned version as XLSX. It turns a simple format conversion into a light data preparation step.
Which method should you use?
| Situation | Best Method |
|---|---|
| Quick one-off conversion, Excel installed | Excel (open and Save As) |
| Data has leading zeros, dates, or long numbers | LibreOffice (type control on import) or Python |
| Need to convert many files regularly | Python script or ssconvert |
| Sensitive data, no upload allowed | Viztab, Excel, LibreOffice, or Python (all local) |
| Want to clean/filter before converting | Viztab or Python |
| File has more than 1M rows | Keep as CSV (XLSX cannot hold it) |
| No software installed, not sensitive data | Google Sheets (upload, File → Download as XLSX) |
Common pitfalls when converting
- Encoding issues. If your CSV is not UTF-8, characters may appear garbled after conversion. Check the encoding first with
file data.csvon macOS/Linux. If it is not UTF-8, convert it before importing:iconv -f ISO-8859-1 -t UTF-8 data.csv > data_utf8.csv. - Delimiter detection. Not all CSV files use commas. Tab-separated (TSV), semicolon-separated, and pipe-separated files are common. If your data looks like it is all in one column after import, the tool guessed the wrong delimiter. Specify it manually.
- Large file truncation. XLSX has a 1,048,576 row limit. If your CSV has more rows, the conversion will silently drop the excess. Always check the row count after conversion. If it is exactly 1,048,576, your data was probably truncated.
- Quoted fields with newlines. CSV allows values to contain newlines if the value is wrapped in double quotes. Some converters mishandle these, creating extra rows where there should be multi-line cell values. Python's
csvmodule handles this correctly. Simpleawk/splitapproaches do not.
Frequently asked questions
CSV (Comma-Separated Values) is a plain text format where each line is a row and values are separated by commas. It stores only raw data — no formatting, formulas, or multiple sheets. XLSX is Microsoft Excel's format. It is a compressed XML archive that supports formatting, formulas, charts, multiple worksheets, and data types. CSV is simpler and more portable; XLSX is richer but tied to spreadsheet applications.
It depends on the data. Online converters require uploading your file to a third-party server. For public or non-sensitive data, this is generally fine. For files containing personal information, financial data, health records, or proprietary business data, uploading to an unknown server is a privacy risk. Offline conversion using Excel, LibreOffice, Python, or Viztab keeps your data on your machine.
Yes, but with caveats. XLSX has the same 1,048,576 row limit as Excel. If your CSV has more rows than that, the conversion will truncate data. Python's openpyxl library can create XLSX files up to the row limit. For larger files, consider keeping the data in CSV or Parquet format and using a tool like Viztab that handles the full file without format conversion.
The conversion itself should not change data values, but some tools apply automatic type detection that can alter data. Excel may convert text that looks like dates (e.g., "1-3" becomes January 3rd) or truncate long numbers. To avoid this, use a tool that lets you specify column types during import, or use Python where you have full control over the conversion process.
Convert CSV to XLSX without uploading
Viztab converts your files right in your browser. No server, no signup, no privacy worries.
Open Viztab