File Formats: .xlsx, .xlsm, .csv, .xlsb

5 min
हिंदी में पढ़ें

What you'll learn

  • The difference between the four main formats
  • Which to use when
  • The CSV trap that catches everyone

Concept

Format What it is When to use it
.xlsx Standard Excel file Default. 95% of cases.
.xlsm Macro-enabled When the file contains VBA code
.csv Plain text, comma-separated Data transfer, import/export
.xlsb Binary Excel Very large files (500MB+)

.xlsx — the default

It is actually a zip file. Try it: copy any .xlsx, change the extension to .zip, and open it — you'll find XML files inside. That's why Python (openpyxl) and other tools can read them.

Formulas, formatting, charts, pivot tables all save here. Macros do not.

.xlsm — for macros

If you write VBA code and save as .xlsx, Excel will warn you and then strip the code out. Macros require .xlsm.

The downside: many companies and email systems block .xlsm attachments for security reasons. Check before sending one to a client.

.csv — the lingua franca of data

Pure plain text. One line per row, columns separated by commas.

Name,City,Amount
Rahul,Delhi,5000
Priya,Mumbai,7200

What CSV does NOT save:

  • Formulas (only their results survive)
  • Formatting, colours, fonts
  • Charts, pivot tables, images
  • Multiple sheets — only the active sheet survives

That last point is the dangerous one. Save a five-sheet file as CSV and four sheets are gone, with only a small warning that most people dismiss by hitting Enter.

The real CSV trap: leading zeros don't survive. A pincode of 110005 is fine, but 0110005 opens as 110005. The same happens to phone numbers, employee IDs and account numbers. So never open a CSV by double-clicking it — import it via Data → From Text/CSV, where you can set the column type to Text.

.xlsb — for large files

A binary format. Same features as .xlsx, but roughly half the file size and noticeably faster to open and save. The drawback is that some tools — Python libraries, Google Sheets — can't read it. Use it only when a file is huge and will stay inside Excel.

The decision, in one block

Has macros?            → .xlsm
Sending to another system? → .csv
File over 100MB?       → .xlsb
Everything else        → .xlsx

Exercises

easyCreate a file with two sheets, each containing some data. Save it as CSV. Now open the CSV — how many sheets are there?
**One** — whichever sheet was active when you saved. The other is gone.
mediumType `=5+5` into a cell. Save as CSV, close, and reopen. Is the cell holding a formula or the number 10?
**10.** Only the value survives; the formula is lost. CSV cannot store formulas.
hardIn Notepad, write the following and save it as `test.csv`: ``` ID,Name 0012,Rahul 0034,Priya ``` Now open it two ways: (a) by double-clicking, and (b) in Excel via Data → From Text/CSV with the ID column type set to Text. What's different about the ID column?
Double-clicking turns `0012` into `12` — the leading zero is stripped. Setting the type to Text in the import wizard preserves `0012`. This is exactly why you import CSVs instead of double-clicking them.

Quiz

Which format does a file with VBA macros need?
.xlsm
Does CSV save multiple sheets?
No, only the active sheet
What is an `.xlsx` file underneath?
A zip file containing XML
Previous lessonNext lesson
File Formats: .xlsx, .xlsm, .csv, .xlsb · Foundations | ExcelWalaa