Showing posts with label Spreadsheets. Show all posts
Showing posts with label Spreadsheets. Show all posts

Monday, September 21, 2026

What Is an .xlsx File?

// spreadsheets

What Is an .xlsx File?

An .xlsx file is a modern spreadsheet file format used by Microsoft Excel and many other spreadsheet programs. It can store worksheets, numbers, text, formulas, tables, charts, formatting and other structured spreadsheet data.

// definition

.xlsx is a spreadsheet file format

An .xlsx file is a spreadsheet workbook stored using Microsoft's Office Open XML spreadsheet format.

It is commonly associated with Microsoft Excel, although other spreadsheet applications can also read and write .xlsx files.

A single workbook can contain multiple worksheets along with formulas, formatting, charts and other spreadsheet information.

// file extension

What does .xlsx mean?

The .xlsx extension identifies an Excel workbook stored using the Office Open XML format.

budget.xlsx customers.xlsx sales-data.xlsx project-tracker.xlsx

The extension tells software what kind of file it is dealing with and which format should be used to interpret the contents.

// workbook

An .xlsx file is a workbook

A workbook can contain one or more worksheets.

sales.xlsx │ ├── January ├── February ├── March └── Summary

Each worksheet contains a grid of rows and columns.

// cells

Spreadsheet data is stored in cells

Each cell is identified by a column and row.

A1 B1 C1 A2 B2 C2

For example:

A B C
Product Quantity Price
Keyboard 2 39.99
Mouse 4 19.50
// cell values

Cells can contain different kinds of information

Text Numbers Dates Times Formulas Booleans Errors
// formulas

.xlsx files can store formulas

A spreadsheet cell does not have to contain only a fixed value.

It can contain a formula:

=A1+B1

or:

=SUM(B2:B20)

The spreadsheet application evaluates the formula and displays the calculated result.

// formula + value

A formula and its displayed result are different things

Suppose a cell contains:

=10+20

The displayed result may be:

30

The workbook can retain the formula rather than simply replacing it with the number 30.

// formatting

.xlsx files can store presentation information

Unlike a simple CSV file, an .xlsx workbook can retain substantial visual formatting.

Fonts Colours Borders Alignment Number Formats Column Widths Row Heights Conditional Formatting
// workbook features

A workbook can contain much more than cells

Worksheets

Multiple spreadsheet pages can exist inside one file.

Charts

Data can be visualised using charts and graphs.

Tables

Structured Excel tables can organise related records.

Formulas

Calculations can reference other cells and sheets.

Validation

Rules can restrict what users are allowed to enter.

Hyperlinks

Cells can contain links to websites and other resources.

// office open xml

An .xlsx file is based on XML

The modern Excel workbook format belongs to the Office Open XML family of file formats.

Internally, workbook information is divided across a collection of structured XML files and related resources.

Workbook ↓ XML documents + relationships + styles + other resources
// zip container

An .xlsx file is also a ZIP package

One of the most interesting facts about .xlsx files is that they are packaged using ZIP compression.

If a copy of an .xlsx file is renamed from:

workbook.xlsx

to:

workbook.zip

ZIP-compatible software can usually open the package and reveal the internal files.

An .xlsx file is not one giant XML document. It is a ZIP package containing multiple XML documents and supporting files organised according to the Office Open XML format.

// internal structure

What is inside an .xlsx file?

A simplified workbook package might contain:

workbook.xlsx │ ├── [Content_Types].xml ├── _rels/ │ ├── docProps/ │ └── xl/ │ ├── workbook.xml ├── styles.xml ├── sharedStrings.xml ├── worksheets/ │ ├── sheet1.xml │ └── sheet2.xml │ └── _rels/

The exact contents depend on which features are used in the workbook.

// worksheet xml

Worksheets are represented using XML

Internally, a worksheet may contain XML structures representing rows and cells.

<row r="1"> <c r="A1"> ... </c> </row>

Spreadsheet software interprets these structures and presents them as the familiar grid seen in Excel.

// shared strings

Text may be stored separately from worksheet cells

Some .xlsx workbooks use a shared strings table.

Instead of repeating the same text many times inside worksheets, cells can reference entries stored in a shared XML structure.

Cell ↓ String reference ↓ sharedStrings.xml ↓ "Freelance Coder"
// styles

Formatting can be stored separately

Workbook styles can be defined in internal style information and referenced by cells.

This avoids having to repeat complete formatting instructions for every individual cell.

// xlsx vs xls

.xlsx replaced the older .xls format

.xls .xlsx
Older Excel format Modern Excel workbook format
Binary file format Office Open XML package
Associated with older Excel versions Introduced with Excel 2007
Legacy format Common modern format
// xlsx vs csv

.xlsx and .csv are very different

CSV XLSX
Plain-text format ZIP-based spreadsheet package
Usually represents one table Can contain multiple worksheets
No native cell formatting Supports extensive formatting
No native charts Can contain charts
Simple data exchange Complete spreadsheet workbook
// important distinction

Saving Excel data as CSV can remove workbook features

Suppose an .xlsx workbook contains:

3 worksheets formulas colours charts cell formatting

Exporting one sheet to CSV normally preserves the tabular values but not the complete workbook structure.

XLSX → full spreadsheet workbook CSV → plain tabular data
// macros

.xlsx files do not normally contain VBA macros

Excel uses a different extension for macro-enabled workbooks:

.xlsm
Extension Workbook type
.xlsx Standard Excel workbook
.xlsm Macro-enabled Excel workbook

This distinction matters. If a workbook depends on VBA macros, saving it as an ordinary .xlsx file is not the appropriate format for retaining those macros.

// programming

.xlsx files can be created by software

Excel itself is not required to generate every .xlsx workbook.

Programming libraries can create, read and modify spreadsheet files automatically.

Python JavaScript PHP Java C# Automation
// python example

Python can create .xlsx files

For example, libraries such as openpyxl can work with Excel workbooks.

from openpyxl import Workbook workbook = Workbook() sheet = workbook.active sheet["A1"] = "Product" sheet["B1"] = "Price" sheet["A2"] = "Keyboard" sheet["B2"] = 39.99 workbook.save("products.xlsx")

Software can therefore generate spreadsheets from databases, APIs and other data sources.

// automation

Spreadsheet generation can be automated

API ↓ Application ↓ Process data ↓ Generate .xlsx ↓ Spreadsheet report

This is useful for reporting, financial data, exports, project tracking and business workflows.

// compatibility

.xlsx files are supported by many applications

Microsoft Excel is the application most strongly associated with .xlsx, but other spreadsheet software can also work with the format.

Microsoft Excel Google Sheets LibreOffice Calc Spreadsheet Libraries

Complex workbook features may not always behave identically when the same file is opened in different spreadsheet applications.

// not plain text

An .xlsx file is not a plain-text file

Although its internal structure contains XML documents, the .xlsx file itself is a compressed package.

Opening it directly in a basic text editor will therefore not display the workbook in the same clean way as opening a CSV, TXT or XML file.

TXT → plain text CSV → plain text XML → plain text XLSX → compressed package containing XML and other resources
// uses

What are .xlsx files used for?

Budgets Accounts Data Analysis Reports Project Tracking Invoices Customer Lists Dashboards Financial Models Data Exports
// mental model

The simplest way to think about .xlsx

.xlsx file ↓ ZIP package ↓ XML + relationships + resources ↓ Workbook ↓ Worksheets ↓ Rows + columns + cells ↓ Values + formulas + formatting
// summary

More than just a table.

An .xlsx file is a modern spreadsheet workbook format based on Office Open XML. It can contain multiple worksheets, values, formulas, formatting, charts and other spreadsheet features. Internally, the workbook is stored as a ZIP package containing XML documents and related resources.

Friday, September 18, 2026

What Is a .csv File?

// file formats

What Is a .csv File?

A .csv file is a simple way of storing tabular data as plain text. It is commonly used to move information between spreadsheets, databases, websites and software applications.

// definition

CSV means Comma-Separated Values

CSV stands for Comma-Separated Values.

A .csv file stores data as plain text, usually with each line representing a row and commas separating the individual values within that row.

This makes CSV particularly useful for information that naturally fits into rows and columns.

// example

What does CSV data look like?

Imagine a spreadsheet containing customer information:

Name,Email,Orders Alice,alice@example.com,4 Ben,ben@example.com,7 Carla,carla@example.com,2

The first line contains the column headings. Each line after that represents one record.

Name Email Orders
Alice alice@example.com 4
Ben ben@example.com 7
Carla carla@example.com 2

The CSV file and the table contain essentially the same information. The difference is how that information is represented.

// structure

Rows, columns and values

Rows

Each line normally represents one record, such as one customer, one product or one transaction.

Columns

Each position within a row represents a particular field, such as a name, price or date.

Delimiter

Commas normally separate the fields from one another, giving the format its name.

Header row

Many CSV files begin with a row containing the names of the columns, although this is not compulsory.

// plain text

A CSV file is still a text file

CSV is a structured text format.

If you open a CSV file in a plain-text editor, you can normally read its contents directly.

However, spreadsheet software such as Microsoft Excel or Google Sheets can interpret the separators and display the information as rows and columns.

Plain Text Rows Columns Records Fields
// quoted values

What happens if the data itself contains a comma?

Sometimes a value needs to contain a comma of its own. In that situation, the value can be enclosed in double quotation marks.

Name,Location Alice,"Birmingham, England" Ben,"London, England"

The quotation marks tell software that the comma inside the location belongs to the value rather than separating two different columns.

// escaping

What about quotation marks inside a value?

If a quoted field itself contains a double quotation mark, CSV commonly represents it by doubling the quotation mark.

Product,Description Book,"The ""Advanced"" Edition"

This allows the quotation mark to remain part of the actual data.

// csv vs spreadsheet

A CSV file is not an Excel workbook

Excel can open CSV files, but that does not make CSV an Excel format.

A normal Excel workbook can store much more than simple tabular values. It can contain formatting, formulas, multiple worksheets, charts and other spreadsheet features.

Feature CSV Excel workbook
Rows and columns Yes Yes
Plain text Yes No
Multiple worksheets No Yes
Cell formatting No Yes
Charts No Yes

Important: when an Excel workbook is exported to CSV, features such as colours, fonts, charts and multiple worksheets are not preserved as part of the CSV format.

// why csv?

Why is CSV so widely used?

Simple

CSV has a straightforward structure that is relatively easy for both people and software to understand.

Portable

CSV files can move data between many different applications and operating systems.

Lightweight

There is very little additional information surrounding the actual data.

Programmable

Programming languages and data tools can easily read, create and transform CSV files.

// uses

What are CSV files used for?

CSV files are common anywhere structured data needs to move from one system to another.

Customer Data Product Lists Transactions Website Data Analytics Database Exports Affiliate Data Inventory Spreadsheets Data Migration
// encoding

CSV and UTF-8

Like other text files, a CSV file must use a character encoding.

UTF-8 is a particularly useful choice because it supports a huge range of characters and languages.

Name,City,Amount João,Lisboa,£25 Élodie,Paris,€40 Sofia,Athens,€32

Important: the .csv extension does not itself guarantee UTF-8. The character encoding is a separate property of the file.

// delimiters

Is a comma always used?

CSV literally means Comma-Separated Values, and commas are the standard delimiter associated with the format.

In practice, however, data files may also use other separators. For example, semicolons are sometimes used because of regional settings or software conventions.

Name;City;Orders Alice;Birmingham;4 Ben;London;7

Files using tabs as separators are commonly called TSV, meaning Tab-Separated Values.

// data management

Why CSV matters in data management

CSV is particularly useful because it provides a simple bridge between different systems.

A database can export records to CSV. A spreadsheet can open them. A script can transform them. Another application can then import the resulting file.

Database ↓ CSV ↓ Spreadsheet ↓ Script / Automation ↓ Another System

This makes CSV extremely useful for data migration, cleaning, imports, exports and automation.

// txt vs csv

How is CSV different from TXT?

Both .txt and .csv files can contain plain text.

The key difference is that CSV normally follows a tabular structure: values are separated into fields and records so that software can interpret them as rows and columns.

A general .txt file does not necessarily have that structure.

Format Main purpose
.txt General plain-text information
.csv Structured tabular data
// summary

Simple text. Structured data.

A .csv file stores tabular information as plain text, normally using commas to separate values and new lines to separate records. Its simplicity makes CSV one of the most useful formats for exchanging data between spreadsheets, databases, websites and software systems.

What Is an IP Address?

// networking What Is an IP Address? An IP address is a numerical address used t...