# Xlsx to Md This article demonstrates how to convert Spreadsheet to Markdown with GroupDocs.Markdown for Python via .NET. Use GroupDocs.Markdown to convert XLSX and other spreadsheet files to Markdown tables. You can control how many columns and rows are included using spreadsheet-specific options. ### Using static method The simplest way to convert a spreadsheet file: {{< tabs "export-spreadsheet-static">}} {{< tab "export_spreadsheet_to_markdown.py" >}} ```python import os from groupdocs.markdown import License, MarkdownConverter def export_spreadsheet_to_markdown(): """Convert an Excel spreadsheet to Markdown using the static one-liner API.""" # Step 1: Apply the license (optional for evaluation) if os.path.exists("GroupDocs.Markdown.lic"): License.set_("GroupDocs.Markdown.lic") # Step 2: Convert the spreadsheet directly to a Markdown file MarkdownConverter.to_file("cost-analysis.xlsx", "export-spreadsheet-static.md") if __name__ == "__main__": export_spreadsheet_to_markdown() ``` {{< /tab >}} {{< tab "cost-analysis.xlsx" >}} {{< tab-text >}} `cost-analysis.xlsx` is sample file used in this example. Click [here](https://docs.groupdocs.com/markdown/python-net/_sample_files/developer-guide/basic-usage/convert/cost-analysis.xlsx) to download it. {{< /tab-text >}} {{< /tab >}} {{< tab "export-spreadsheet-static.md" >}} ```text ## Summary | Category | FY2024 | FY2025 | FY2026 | | --- | --- | --- | --- | | Parts and materials | $1,325,000.00 | $1,480,000.00 | $1,620,000.00 | | Manufacturing equipment | $900,500.00 | $980,000.00 | $1,050,000.00 | | Warehousing | $420,000.00 | $510,000.00 | $590,000.00 | | Shipping | $380,000.00 | $445,000.00 | $520,000.00 | | Marketing | $250,000.00 | $340,000.00 | $480,000.00 | | R&D | $180,000.00 | $230,000.00 | $310,000.00 | [TRUNCATED] ``` [Download full output](https://docs.groupdocs.com/markdown/python-net/_output_files/developer-guide/basic-usage/convert/export-spreadsheet/export_spreadsheet_to_markdown/export-spreadsheet-static.md) {{< /tab >}} {{< /tabs >}} ### Using instance API with options For more control, use the instance API. The `ConvertOptions` class provides spreadsheet-specific properties such as `max_columns` and `max_rows` to limit the size of the exported tables: {{< tabs "export-spreadsheet-instance">}} {{< tab "export_spreadsheet_with_options.py" >}} ```python import os from groupdocs.markdown import License, MarkdownConverter, ConvertOptions def export_spreadsheet_with_options(): """Convert an Excel spreadsheet to Markdown with column/row limits and heading offset.""" # Step 1: Apply the license (optional for evaluation) if os.path.exists("GroupDocs.Markdown.lic"): License.set_("GroupDocs.Markdown.lic") # Step 2: Open the spreadsheet with a context manager with MarkdownConverter("cost-analysis.xlsx") as converter: # Step 3: Configure spreadsheet-specific conversion options options = ConvertOptions() options.max_columns = 10 # limit to first 10 columns options.max_rows = 100 # limit to first 100 data rows per sheet options.heading_level_offset = 1 # shift headings down one level # Step 4: Convert and save the Markdown output converter.convert("export-spreadsheet-instance.md", convert_options=options) if __name__ == "__main__": export_spreadsheet_with_options() ``` {{< /tab >}} {{< tab "cost-analysis.xlsx" >}} {{< tab-text >}} `cost-analysis.xlsx` is sample file used in this example. Click [here](https://docs.groupdocs.com/markdown/python-net/_sample_files/developer-guide/basic-usage/convert/cost-analysis.xlsx) to download it. {{< /tab-text >}} {{< /tab >}} {{< tab "export-spreadsheet-instance.md" >}} ```text ## Summary | Category | FY2024 | FY2025 | FY2026 | | --- | --- | --- | --- | | Parts and materials | $1,325,000.00 | $1,480,000.00 | $1,620,000.00 | | Manufacturing equipment | $900,500.00 | $980,000.00 | $1,050,000.00 | | Warehousing | $420,000.00 | $510,000.00 | $590,000.00 | | Shipping | $380,000.00 | $445,000.00 | $520,000.00 | | Marketing | $250,000.00 | $340,000.00 | $480,000.00 | | R&D | $180,000.00 | $230,000.00 | $310,000.00 | [TRUNCATED] ``` [Download full output](https://docs.groupdocs.com/markdown/python-net/_output_files/developer-guide/basic-usage/convert/export-spreadsheet/export_spreadsheet_with_options/export-spreadsheet-instance.md) {{< /tab >}} {{< /tabs >}} For the full list of input formats, see the [supported formats page]({{< ref "markdown/python-net/getting-started/supported-document-formats" >}}).