IRONSOFTWAREHOME
Convert Spreadsheet File Types
from ironxl import *

# Import any XLSX, XLS, XLSM, XLTX, CSV, and TSV
workbook = WorkBook.Load("sample.xlsx")

# Export the excel file as XLS, XLSX, XLSM, CSV, TSV, JSON, XML
workbook.SaveAs("sample.xls")
workbook.SaveAs("sample.xlsx")
workbook.SaveAs("sample.tsv")
workbook.SaveAsCsv("sample.csv")
workbook.SaveAsJson("sample.json")
workbook.SaveAsXml("sample.xml")

# Export the excel file as HTML, HTML string
workbook.ExportToHtml("sample.html")
html_string = workbook.ExportToHtmlString()

# Export the excel file as Binary, Byte array, Data set, Stream
binary_data = workbook.ToBinary()
byte_array_data = workbook.ToByteArray()
pip install ironxl
Convert Spreadsheet File Types

Convert Spreadsheet File Types

IronXL for Python offers a simple and flexible way to import and export Excel data across a wide range of formats. It supports XLS, XLSX, CSV, JSON, XML, and HTML, making it suitable for diverse application requirements. With just a few lines of Python, developers can convert Excel data into formats ready for web integration, APIs, or further data processing.

Exporting Excel files as HTML or JSON makes it easy to embed data into web applications, while converting to binary, byte arrays, or streams enables integration with databases or other systems. Converting Excel content to a DataSet simplifies populating SQL databases or data grids. This reduces manual coding, enhances productivity, and makes IronXL a valuable tool for modern data-driven Python applications.

5 Steps to Export Excel Files in Multiple Formats

This example begins by loading an existing Excel file, Sample.xlsx, into a WorkBook object. This object serves as the central hub for manipulating and exporting data. Using the SaveAs method, the workbook is saved as an .xlsx file, ensuring compatibility with modern Excel applications.

Next, the SaveAsJson method converts the workbook into JSON format, making it suitable for API responses or lightweight data exchange. The ToDataSet method enables seamless database or UI component integration by converting the workbook into a tabular data structure.

Finally, the ExportToHtml method generates an HTML file that renders the Excel data directly in a web browser. These capabilities streamline data processing tasks and make IronXL an exceptional tool for Python developers working with Excel files.

Learn to Convert Excel File Types Effortlessly with Python

Ready to Get Started?

Version:2026.10just released

Key in blue circle

Get your free 30-day Trial Key instantly

Your trial license will be sent to your email address

No limitations. 100% unlocked. No credit card.

bullet_checkedNo credit card or account creation requiredNo limitations. 100% unlocked. No credit card.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronXL for Python
Book your free Live Demo
Booking Badge

Trusted by Millions of Engineers Worldwide

Iron Software's customer logos
Get a Quote, No Obligation
Your details will always be kept confidential.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Trusted by Millions of Engineers Worldwide
Get your free 30-day Trial Key instantly.
No credit card or account creation required
Python Module Download for Excel
Install with pip

Version: 2026.10

  1. Download and install Python 3.7+.
  2. Install pip from pypi.org if it isn't installed already.
  3. Execute the above command in the terminal.
Python PDF Module
Download Module

Version: 2026.10

Manually install into your project

  1. Download the package
  2. Run this command from the terminal
    pip install IronXL-2026.10-py37-none-win_amd64.whi

Licenses from $999