File type for excel

I want excel files on a website to open in Excel when clicked, not get saved on desktop, or get opened embedded in a browser etc. Now obviously it all depends on how everything is configured for each user, but what’s the best Content-Type and other settings to achieve just that most of the time?

asked May 30, 2010 at 3:54

taw's user avatar

2

For BIFF .xls files

application/vnd.ms-excel

For Excel2007 and above .xlsx files

application/vnd.openxmlformats-officedocument.spreadsheetml.sheet

answered May 30, 2010 at 10:15

Mark Baker's user avatar

Mark BakerMark Baker

208k31 gold badges340 silver badges383 bronze badges

16

answered May 30, 2010 at 3:57

miku's user avatar

mikumiku

179k46 gold badges308 silver badges309 bronze badges

2

Do keep in mind that the file.getContentType could also output application/octet-stream instead of the required application/vnd.openxmlformats-officedocument.spreadsheetml.sheet when you try to upload the file that is already open.

CSchulz's user avatar

CSchulz

10.8k10 gold badges59 silver badges112 bronze badges

answered Feb 26, 2014 at 20:43

DiTap's user avatar

DiTapDiTap

3612 silver badges5 bronze badges

You can save an Excel file in another file format by clicking the File > Save As. The file formats that are available in the Save As dialog box vary, depending on what type of sheet is active (a worksheet, chart sheet, or other type of sheet).

Note: Whenever you save a file in another file format, some of its formatting, data, and features might not be transferred.

To open a file that was created in another file format, either in an earlier version of Excel or in another program, click File > Open. If you open an Excel 97-2003 workbook, it automatically opens in Compatibility Mode. To take advantage of the new features of Excel 2010, you can save the workbook to an Excel 2010 file format. However, you also have the option to continue to work in Compatibility Mode, which retains the original file format for backward compatibility.

Excel file formats

Format

Extension

Description

Excel Workbook

.xlsx

The default XML-based file format for Excel 2010 and Excel 2007. Cannot store Microsoft Visual Basic for Applications (VBA) macro code or Microsoft Office Excel 4.0 macro sheets (.xlm).

Excel Macro-Enabled Workbook (code)

.xlsm

The XML-based and macro-enabled file format for Excel 2016, Excel 2013, Excel 2010, and Excel 2007. Stores VBA macro code or Excel 4.0 macro sheets (.xlm).

Excel Binary Workbook

.xlsb

The binary file format (BIFF12) for Excel 2010 and Excel 2007.

Template

.xltx

The default file format for an Excel template for Excel 2010 and Excel 2007. Cannot store VBA macro code or Excel 4.0 macro sheets (.xlm).

Template (code)

.xltm

The macro-enabled file format for an Excel template Excel 2010 and Excel 2007. Stores VBA macro code or Excel 4.0 macro sheets (.xlm).

Excel 97- Excel 2003 Workbook

.xls

The Excel 97 — Excel 2003 Binary file format (BIFF8).

Excel 97- Excel 2003 Template

.xlt

The Excel 97 — Excel 2003 Binary file format (BIFF8) for an Excel template.

Microsoft Excel 5.0/95 Workbook

.xls

The Excel 5.0/95 Binary file format (BIFF5).

XML Spreadsheet 2003

.xml

XML Spreadsheet 2003 file format (XMLSS).

XML Data

.xml

XML Data format.

Excel Add-In

.xlam

The XML-based and macro-enabled Add-In format for Excel 2010 and Excel 2007. An Add-In is a supplemental program that is designed to run additional code. Supports the use of VBA projects and Excel 4.0 macro sheets (.xlm).

Excel 97-2003 Add-In

.xla

The Excel 97-2003 Add-In, a supplemental program that is designed to run additional code. Supports the use of VBA projects.

Excel 4.0 Workbook

.xlw

An Excel 4.0 file format that saves only worksheets, chart sheets, and macro sheets. You can open a workbook in this file format in Excel 2010, but you cannot save an Excel file to this file format.

Works 6.0-9.0 spreadsheet

.xlr

Spreadsheet saved in Microsoft Works 6.0-9.0.

Note: This format is supported in Excel Starter only.

Text file formats

Format

Extension

Description

Formatted Text (Space-delimited)

.prn

Lotus space-delimited format. Saves only the active sheet.

Text (Tab-delimited)

.txt

Saves a workbook as a tab-delimited text file for use on another Microsoft Windows operating system, and ensures that tab characters, line breaks, and other characters are interpreted correctly. Saves only the active sheet.

Text (Macintosh)

.txt

Saves a workbook as a tab-delimited text file for use on the Macintosh operating system, and ensures that tab characters, line breaks, and other characters are interpreted correctly. Saves only the active sheet.

Text (MS-DOS)

.txt

Saves a workbook as a tab-delimited text file for use on the MS-DOS operating system, and ensures that tab characters, line breaks, and other characters are interpreted correctly. Saves only the active sheet.

Unicode Text

.txt

Saves a workbook as Unicode text, a character encoding standard that was developed by the Unicode Consortium.

CSV (comma delimited)

.csv

Saves a workbook as a comma-delimited text file for use on another Windows operating system, and ensures that tab characters, line breaks, and other characters are interpreted correctly. Saves only the active sheet.

CSV (Macintosh)

.csv

Saves a workbook as a comma-delimited text file for use on the Macintosh operating system, and ensures that tab characters, line breaks, and other characters are interpreted correctly. Saves only the active sheet.

CSV (MS-DOS)

.csv

Saves a workbook as a comma-delimited text file for use on the MS-DOS operating system, and ensures that tab characters, line breaks, and other characters are interpreted correctly. Saves only the active sheet.

DIF

.dif

Data Interchange Format. Saves only the active sheet.

SYLK

.slk

Symbolic Link Format. Saves only the active sheet.

Note: If you save a workbook in any text format, all formatting is lost.

Other file formats

Format

Extension

Description

DBF 3, DBF 4

.dbf

dBase III and IV. You can open these files formats in Excel, but you cannot save an Excel file to dBase format.

OpenDocument Spreadsheet

.ods

OpenDocument Spreadsheet. You can save Excel 2010 files so they can be opened in spreadsheet applications that use the OpenDocument Spreadsheet format, such as Google Docs and OpenOffice.org Calc. You can also open spreadsheets in the .ods format in Excel 2010. Formatting might be lost when saving and opening .ods files.

PDF

.pdf

Portable Document Format (PDF). This file format preserves document formatting and enables file sharing. When the PDF format file is viewed online or printed, it retains the format that you intended. Data in the file cannot be easily changed. The PDF format is also useful for documents that will be reproduced by using commercial printing methods.

Note: This format is not supported in Excel 2007.

XPS Document

.xps

XML Paper Specification (XPS). This file format preserves document formatting and enables file sharing. When the XPS file is viewed online or printed, it retains exactly the format that you intended, and the data in the file cannot be easily changed.

Note: This format is not supported in Excel 2007.

File formats that use the Clipboard

You can paste data from the Microsoft Office Clipboard into Excel by using the Paste or Paste Special command (Home tab, Clipboard group, Paste button) if the Office Clipboard data is in one of the following formats.

Format

Extension

Clipboard type identifiers

Picture

.wmf or .emf

Pictures in Windows Metafile Format (WMF) or Windows Enhanced Metafile Format (EMF).

Note    If you copy a Windows metafile picture from another program, Excel pastes the picture as an enhanced metafile.

Bitmap

.bmp

Pictures stored in Bitmap format (BMP).

Microsoft Excel file formats

.xls

Binary file formats for Excel versions 5.0/95 (BIFF5), Excel 97-2003 (BIFF8), and Excel 2010 (BIFF12).

SYLK

.slk

Symbolic Link Format.

DIF

.dif

Data Interchange Format.

Text (tab-delimited)

.txt

Tab-separated text format.

CSV (Comma-delimited)

.csv

Comma-separated values format.

Formatted text (Space-delimited)

.rtf

Rich Text Format (RTF). Only from Excel.

Embedded object

.gif, .jpg, .doc, .xls, or .bmp

Microsoft Excel objects, objects from properly registered programs that support OLE 2.0 (OwnerLink), and Picture or another presentation format.

Linked object

.gif, .jpg, .doc, .xls, or .bmp

OwnerLink, ObjectLink, Link, Picture, or other format.

Office drawing object

.emf

Office drawing object format or Picture (Windows enhanced metafile format, EMF).

Text

.txt

Display Text, OEM Text.

Single File Web Page

.mht, .mhtml

Single File Web Page (MHT or MHTML). This file format integrates inline graphics, applets, linked documents, and other supporting items referenced in the document.

Note: This format is not supported in Excel 2007.

Web Page

.htm, .html

Hypertext Markup Language (HTML).

Note: When you copy text from another program, Excel pastes the text in HTML format, regardless of the format of the original text.

File formats that are not supported in Excel

The following file formats are no longer supported in Excel 2016, Excel 2013, Excel 2010, Excel Starter, and Excel 2007. You cannot open or save files in these file formats.

Format

Extension

Clipboard type identifiers

Excel Chart

.xlc

Excel 2.0, 3.0, and 2.x file formats

WK1, FMT, WK2, WK3, FM3, WK4

.wk1, .wk2, .wk3, .wk4, .wks

Lotus 1-2-3 file formats (all versions)

Microsoft Works

.wks

Microsoft Works file format (all versions)

DBF 2

.dbf

DBASE II file format

WQ1

.wq1

Quattro Pro for MS-DOS file format

WB1, WB3

.wb1, .wb3

Quattro Pro 5.0 and 7.0 for Windows.

File formats that are not supported in Excel Starter

Additionally, the following file formats are no longer supported in Excel Starter. You cannot open or save files in these file formats.

Format

Extension

Excel 97-2003 Add-In

.xla

Excel Add-In

.xlam

Data source name

.dsn

Access MDE database

.mde

Office Data Connection

.odc

Data Link File

.udl

Opening or viewing unsupported file formats

If a file format that you want to use is not supported in Excel, you can try the following:

  • Search the Internet for a company that makes file format converters for file formats that are not supported in Excel.

  • Save to a file format that another program supports and then export from that program into a file format that Excel supports.

Need more help?

You can always ask an expert in the Excel Tech Community or get support in the Answers community.

Related Topics

Excel formatting and features that are not transferred to other file formats

MIME (Multipurpose Internet Mail Extensions) is a media type used to identify a type of data on the Internet or by applications. Its name contains the word «Internet» but it is not only limited to the Internet.IANA is in charge of standardizing and disseminating these MIME classifications.

There are numerous popular extensions available among them. One of them is the Excel MIME type.

Every mime type is divided into two parts, which are separated by a slash (/).

1 Type is a logical grouping of many MIME types that are similar to one another. All Excel files have an application as a type.

2 SubType is specific to a single file type within the «type«.They are unique within the «type».Some of the subtypes for excel files are: vnd.ms-excel,vnd.openxmlformats-officedocument.spreadsheetml.sheet,vnd.openxmlformats-officedocument.spreadsheetml.template,vnd.ms-excel.sheet.macroEnabled.12 etc.

There are various MIME types for Excel for various Excel-related files and their extensions such as. xls,.xlsx,.xlt,.xla, and so on.

Let’s look at Excel file MIME Type and extension used by them in table format.

Extension  MIME Type (Type / SubType) Kind of Document
.xls application/vnd.ms-excel  Microsoft Excel   
.xlsx application/vnd.openxmlformats-officedocument.spreadsheetml.sheet  Microsoft Excel (OpenXML) 
.xltx  application/vnd.openxmlformats-officedocument.spreadsheetml.template Office Excel 2007 template
.xlsm application/vnd.ms-excel.sheet.macroEnabled.12  Office Excel 2007 macro-enabled workbook
.xltm application/vnd.ms-excel.template.macroEnabled.12 Office Excel 2007 macro-enabled workbook template
.xlam application/vnd.ms-excel.addin.macroEnabled.12 Office Excel 2007 macro-enabled add-in
.xlsb application/vnd.ms-excel.sheet.binary.macroEnabled.12 Office Excel 2007 non xml binary workbook

various-format-of-excel-file

fig. various format for saving excel file

Let’s explain them in brief.

1 .xls

.xls is one of the older file extension of Microsoft Excel Spreadsheet.It is created by Excel 97 or Excel 2003. They by default generate .xls format.

MIME Type Supported by .xls file is application/vnd.ms-excel where the application of MIME type and vnd.ms-excel is subtypes and vnd here means vendor-specific which in this case vendor is Microsoft.

If you have an.xls file and want to open it in Excel before prior 2007, you can do so easily because Excel before 2007 recognizes application/vnd.ms-excel and does not require to afford to open it.

Despite the fact that the.xls file format is older, it can be opened in all versions of Excel due to backward compatibility in newer versions.

2 .xlsx

xlsx is the new file extension of the Microsoft Excel Spreadsheet. It is created by Excel 2007 and later versions.

If you create an excel file in Excel 2007 or later, it will be saved with the.xlsx extension by default; however, you can also save the same file in.xls format.xlsx is more secure and better for data storage(ie. smaller file size) than xls.

MIME type for .xlsx file is application/vnd.openxmlformats-officedocument.spreadsheetml.sheet where MIME type is application and subtype is vnd.openxmlformats-officedocument.spreadsheetml.sheet

It is a file format based on Office OPEN XML developed by Microsoft for representing spreadsheets. Because xlsx is an open standard, other software application vendors, such as Google (Google Sheets), can use it to interoperate with their spreadsheet applications.

📑 The last «x» in the xlsx file extension indicates that the file is based on the XML Standard.

You can open Xls file in excel 2007 and later and convert them to xlsx and save it.

3 .xltx 

Microsoft Excel Template files with the. xltx extensions are based on the Office OpenXML file format specifications. It is used to generate a standard template file that can be used to generate XLSX files with the same settings as the XLTX file.

MIME type for .xlsx file is application/vnd.openxmlformats-officedocument.spreadsheetml.template where MIME type is application and subtype is vnd.openxmlformats-officedocument.spreadsheetml.sheet

It is XML based file format developed by Microsoft for representing templates. An XLTX is identical to an XLSX in every way except that Excel creates a new instance of an XLSX if the file opened is an XLTX.

📓 xltx is the replacement for the old .xlt format.

4  .xlsm

An XLSM file is a macro-enabled spreadsheet created by Microsoft Excel that can also be opened with Google Sheets.XLSM files are based on the Office Open XML format, where the last «m» of an xlsm file extension indicates that the file contains macros.Macros can be stored within an xlsm file, allowing users to automate repetitive tasks.

MIME type for .xlsx file is application/vnd.ms-excel.sheet.macroEnabled.12 where MIME type is application and subtype is vnd.ms-excel.sheet.macroEnabled.12

5  .xlam

An XLAM file extension indicates an Excel Macro-Enabled Add-In file, which is used to provide additional functionality for spreadsheets.
It has the following MIME types:application/vnd.ms-excel.template.macroEnabled.12 where MIME type is application and subtype is vnd.ms-excel.template.macroEnabled.12

Because of the file’s purpose, there is built-in macro support in .xlam files.

6 .xlsb

An XLSB file is an Excel Binary Workbook file that stores data in binary rather than XML format. Because they are stored in binary, the read and write times in xlsb files are faster, and they have been found to be useful for very large and complex spreadsheets for this reason. They are also smaller in size than the XLSM format.

MIME type for .xlsx file is application/vnd.ms-excel.sheet.binary.macroEnabled.12 where MIME type is application and subtype is vnd.ms-excel.sheet.binary.macroEnabled.12

FAQ:

How to generate .xls file in C# ?

For generating a .xls file in C# code you have to mention application/vnd.ms-excel MIME types in response header as shown below.

Response.ContentType = "application/vnd.ms-excel";
Response.AppendHeader("content-disposition", "attachment; filename=sample.xls");

How to generate .xlsx file in C#?

For generating a .xls file in C# code you have to mention application/vnd.openxmlformats-officedocument.spreadsheetml.sheet MIME types in response header as shown below.

Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
Response.AppendHeader("content-disposition", "attachment; filename=sample.xls");

If you are generating Excel file target to xlsx file then you have to use above.

What is the replacement of the xla format?

Ans: xlam is the replacement for the old .xla format.

Probably 99% of all Excel workbooks are saved in the XLSX file type these days. But there are various other file extensions available: For example XLSM, XLSB or “older” Excel users might still remember the XLS file type. What are the differences of these file types? And even more important: Which one should you use?

excel, file type, file types, types, save as, extension, xlsx, xlsb
Excel provides 29 different file types when you save your Excel workbook.

When you save an Excel workbook for the first time or use the “Save As” function, you are asked for a folder, file name as well as the file type. By default, Excel suggests the XLSX file type (unless your file has VBA macros). The window looks similar to the screenshot on the right side.

So which file type are you going to use? The answer – like so often: It depends. Before we conclude in a decision tree, we we take a look at the most important file extensions in Excel with their advantages and disadvantages first.

XLSX

The “default” file extension is XLSX. The large majority of Excel workbooks uses this format these days. Microsoft says in the Excel help text about the XLSX file format:

The default XML-based file format for Excel 2007-2013. Cannot store Microsoft Visual Basic for Applications (VBA) macro code […].

Most of the time you use the XLSX format: It’s save (can’t store malicious code), has the maximum number of rows and columns and is best known. XLSX is available since Excel 2007 and replaces the old XLS file type. It uses the open XML standard so which is documented well.

Knowing these quick facts, there are the following advantages and disadvantages for the XLSX file format:

Advantages Disadvantages
  • The default file format and because of that the best known and widest spread file type.
  • Can use up to 2^20 (1048576) rows and 2^14 (=16384) columns.
  • Uses the open file format and is in general accessible with other applications.
  • Secure because it can’t save VBA macros.
  • Can use and save all the functions available in Excel.
  • A little bit contradicting: But not being able to include VBA macros can be an advantage and disadvantage at the same time.
  • Needs more disk space than other file formats (e.g. XLSB).
  • Can’t be opened with Excel versions before 2003 (e.g. 2003, at least without any further conversion of Excel extension/ add-in).

XLS

advice, xls, file type, extension, excel

The XLS file type has been the default Excel file extension and format before Excel 2007. In Excel 2007, XLSX replaced the XLS format. Therefore, XLS is kind of outdated right now. In the daily life you won’t find it often any more. But some data base tools still export data as XLS files.

The XLS file type has some disadvantages towards the newer file types XLSX or XLSM: It’s rather unsafe as it can contain VBA macros with malicious code. Also, it needs more disk space than the other file types and at the same time has less rows and columns.

On the other side the only advantage: You can easily open XLS files with older versions of Excel.

Advantages Disadvantages
  • Can be opened with Excel versions before 2007 (e.g. 2003).
  • Unsafe as it can contain VBA macros.
  • Needs more disk space than most of the other file formats (e.g. XLSX, XLSB).
  • Can’t use all newer Excel functions, e.g. formulas or functionality (you will be warned when saving an XLS file though).
  • Can only use up to 65,536 (2^16) rows and 256 (2^8) rows.
  • Outdated…

XLSM

If you include VBA macros in your XLSX file, you will be asked to change the file extension to XLSM. Only that way you can save your macro within the Excel file (there are other file types possible, e.g. XLSB – but you can’t use XLSX for VBA macros). Therefore, it has most of the advantages and disadvantages of the XLSX file type. Positive: You can immediately identify Excel files with VBA macros.

Advantages Disadvantages
  • The default Excel file type for workbooks with VBA macros.
  • Can use up to 2^20 (1048576) rows and 2^14 (=16384) columns.
  • Uses the open file format and is therefore accessible with other applications.
  • Can use and save all the functions available in Excel.
  • Uses the open XML standard.
  • Unsafe: Can contain malicious code within the VBA part.
  • Needs more disk space than other file formats (e.g. XLSB).
  • Can’t be opened with Excel versions before 2003 (e.g. 2003, at least without any further conversion of Excel extension/ add-in).

XLSB

advice, xlsb, excel, file, type

Many people don’t know that there is an actual alternative to the XLSX and XLSM file type: The XLSB file extension. XLSB files store the data a little bit different than the XLSX or XLSM file types: They don’t use the XLM file structure. Instead, XLSB files try to save disk space because the data is stored in the binary structure. The main difference: Binary files are computer- but not human-readable. For more information on binary files in general, please refer to this Wikipedia entry.

The main disadvantage: Binary Excel files can contain VBA macros. So unless you don’t know the origin of a file, please consider well before opening them. Besides that: All the other disadvantages seem minor.

Advantages Disadvantages
  • Smaller file size.
  • Faster opening and closing of files.
  • Formulas with more than 8192 characters allowed.
  • Can use and save all the functions available in Excel.
  • Security: Files can contain VBA code whereas XLSX files can’t.
  • You can’t change the Excel ribbon.
  • Some third party tools (e.g. OpenOffice) might not be able to open your file.
  • You can’t open your files with Excel 2003 or earlier (which nowadays should not be a problem any more…).
  • Not very well known. So people might get confused receiving XLSB files from you.

Do you want to boost your productivity in Excel?

Get the Professor Excel ribbon!

Add more than 120 great features to Excel!


CSV

csv, advice, excel, export

CSV stands for comma separated values. These files are basically plain text – so there are no formulas or formatting. CSV is often used for data exchange. Excel provides the functionality to import or even directly open CSV files.

The basic application for CSV files: Import or export data. Data base programs often export data as CSV files. Also if you want to transport Excel data into a database program, often the CSV file type works.

Advantages Disadvantages
  • Smaller file size.
  • Faster opening and closing of files.
  • Unlimited rows and columns.
  • No code or macros possible and therefore save to open.
  • CSV files are basically text documents and therefore can’t contain formulas or formatting, pure data.
  • No more than one “worksheet”.

ODS

ODS stands for Open Document Spreadsheet. The file type is designed to work on both Excel and other applications, e.g. LibreOffice. From the Excel point of view, ODS doesn’t support all the features. Text and data is usually saved well though. But formatting and many other features (for example charts, tables, conditional formatting) might run into problems.

Advantages Disadvantages
  • Can be opened in Excel and LibreOffice.
  • You might lose formatting or features which are not supported. For a detailed lists of the features supported, please refer to this website.

XLSX (Strict)

Besides the regular XLSX format, Excel offers to save your Excel workbook as “Strict Open XML Spreadsheet”. So what is the difference between those two? Basically, the two file types use the same structure. But:

The Strict variant has less support for backwards compatibility when converting documents from older formats.

Furthermore:

The Strict variant of XLSX disallows a variety of elements and attributes that are permitted in the more common Transitional variant […]

Advantages Disadvantages
  • Same as XLSX.
  • Additionally: Opening in other applications than Excel might work better.
  • Some backward compatibility problems might occur.

PDF

pdf, advice

As you’ve probably heard of PDF files, we won’t go much into detail here. PDF stands for portable document format and has the reputation of not easily being manipulated. Also, it’s quite save to say that how a PDF file looks on your computer, it will most probably look like this on most other computers.

And that’s it for the advantages. I recommend using it when you present your final results in the following cases:

  • The recipient of your file should not edit it any more.
  • Formatting should be exactly preserved.
  • There is no database included, just the summarized results.

That could be the case if somebody wants to check your results on an iPad or a similar device. But: In many cases it would be professional (and nice) to also send at least parts of your Excel file. That way, your recipient could at least take a look at the calculation process.

Advantages Disadvantages
  • Static, therefore contents can not (easily) be manipulated.
  • The document always look the same.
  • No macros.
  • Formulas etc. will be lost.
  • Difficult (and troublesome) to further edit the file.
  • (Depending on the contents) large file size.

XLAM

XLAM is the file extension for Excel add-ins. Also our add-ins (for example the popular “Professor Excel Tools“) are XLAM files. They can contain VBA macros, worksheets as well as forms, images and individual ribbons. If you double click on such file, it will open in Excel and you can use the funcationality of the add-in. But next time you open Excel again, it won’t be available any longer. You rather have to enable the add-in within the options (File –> Options –> Add-Ins).

As the XLAM file type is not really an alternative for all the other file extensions above, we skip the advantages and disadvantages.

Comparison of file types

So if we put all the advantages, disadvantages and facts from above together, we come to the following comparison:

Which file type should you use?

Decision Tree

In order to define the best file type for your Excel workbook, please follow the decision tree.

Follow the Professor Excel decision tree for finding the best file type for your Excel workbook.
  • The first question: Do you just want to display your results only? Then you could also consider the PDF format. But if the recipient of your work wants to edit or follow up your calculations, you shouldn’t use PDF.
  • Does your file contain VBA macros?
    • If yes, choose XLSB if you have a large file. Choose XLSM for a file size smaller than app. 10 MB.
    • If no and you got a large file (larger than app. 10 MB), also choose XLSB.
    • If no (you don’t have macros) and your file small, follow the tree on the right hand side.
  • The lower two levels of the decision tree are just about compatibility: If you want to open and edit your workbook with another software, choose the strict XLSX or ODF format.
  • If you want to make sure that you can open it with versions of Excel 2003 or earlier, go for XLS.

Summary

In conclusion, you can distill a quite short table (if you don’t need to consider old file types and other applications as LibreOffice). You just have to answer two questions: Do you need VBA macros and do you work with a large amount of data?

summary, file type, xlsx, xlsm, xlsb

Содержание

  1. Common MIME types
  2. Found a content problem with this page?
  3. What is MIME Type for Excel Document ?
  4. 1 .xls
  5. 2 .xlsx
  6. 3 .xltx
  7. 4 .xlsm
  8. 5 .xlam
  9. 6 .xlsb

Common MIME types

This topic lists the most common MIME types with corresponding document types, ordered by their common extensions.

The following two important MIME types are the default types:

  • text/plain is the default value for textual files. A textual file should be human-readable and must not contain binary data.
  • application/octet-stream is the default value for all other cases. An unknown file type should use this type. Browsers are particularly careful when manipulating these files to protect users from software vulnerabilities and possible dangerous behavior.

IANA is the official registry of MIME media types and maintains a list of all the official MIME types. This table lists important MIME types for the Web:

Extension Kind of document MIME Type
.aac AAC audio audio/aac
.abw AbiWord document application/x-abiword
.arc Archive document (multiple files embedded) application/x-freearc
.avif AVIF image image/avif
.avi AVI: Audio Video Interleave video/x-msvideo
.azw Amazon Kindle eBook format application/vnd.amazon.ebook
.bin Any kind of binary data application/octet-stream
.bmp Windows OS/2 Bitmap Graphics image/bmp
.bz BZip archive application/x-bzip
.bz2 BZip2 archive application/x-bzip2
.cda CD audio application/x-cdf
.csh C-Shell script application/x-csh
.css Cascading Style Sheets (CSS) text/css
.csv Comma-separated values (CSV) text/csv
.doc Microsoft Word application/msword
.docx Microsoft Word (OpenXML) application/vnd.openxmlformats-officedocument.wordprocessingml.document
.eot MS Embedded OpenType fonts application/vnd.ms-fontobject
.epub Electronic publication (EPUB) application/epub+zip
.gz GZip Compressed Archive application/gzip
.gif Graphics Interchange Format (GIF) image/gif
.htm , .html HyperText Markup Language (HTML) text/html
.ico Icon format image/vnd.microsoft.icon
.ics iCalendar format text/calendar
.jar Java Archive (JAR) application/java-archive
.jpeg , .jpg JPEG images image/jpeg
.js JavaScript text/javascript (Specifications: HTML and RFC 9239)
.json JSON format application/json
.jsonld JSON-LD format application/ld+json
.mid , .midi Musical Instrument Digital Interface (MIDI) audio/midi , audio/x-midi
.mjs JavaScript module text/javascript
.mp3 MP3 audio audio/mpeg
.mp4 MP4 video video/mp4
.mpeg MPEG Video video/mpeg
.mpkg Apple Installer Package application/vnd.apple.installer+xml
.odp OpenDocument presentation document application/vnd.oasis.opendocument.presentation
.ods OpenDocument spreadsheet document application/vnd.oasis.opendocument.spreadsheet
.odt OpenDocument text document application/vnd.oasis.opendocument.text
.oga OGG audio audio/ogg
.ogv OGG video video/ogg
.ogx OGG application/ogg
.opus Opus audio audio/opus
.otf OpenType font font/otf
.png Portable Network Graphics image/png
.pdf Adobe Portable Document Format (PDF) application/pdf
.php Hypertext Preprocessor (Personal Home Page) application/x-httpd-php
.ppt Microsoft PowerPoint application/vnd.ms-powerpoint
.pptx Microsoft PowerPoint (OpenXML) application/vnd.openxmlformats-officedocument.presentationml.presentation
.rar RAR archive application/vnd.rar
.rtf Rich Text Format (RTF) application/rtf
.sh Bourne shell script application/x-sh
.svg Scalable Vector Graphics (SVG) image/svg+xml
.tar Tape Archive (TAR) application/x-tar
.tif , .tiff Tagged Image File Format (TIFF) image/tiff
.ts MPEG transport stream video/mp2t
.ttf TrueType Font font/ttf
.txt Text, (generally ASCII or ISO 8859-n) text/plain
.vsd Microsoft Visio application/vnd.visio
.wav Waveform Audio Format audio/wav
.weba WEBM audio audio/webm
.webm WEBM video video/webm
.webp WEBP image image/webp
.woff Web Open Font Format (WOFF) font/woff
.woff2 Web Open Font Format (WOFF) font/woff2
.xhtml XHTML application/xhtml+xml
.xls Microsoft Excel application/vnd.ms-excel
.xlsx Microsoft Excel (OpenXML) application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
.xml XML application/xml is recommended as of RFC 7303 (section 4.1), but text/xml is still used sometimes. You can assign a specific MIME type to a file with .xml extension depending on how its contents are meant to be interpreted. For instance, an Atom feed is application/atom+xml , but application/xml serves as a valid default.
.xul XUL application/vnd.mozilla.xul+xml
.zip ZIP archive application/zip
.3gp 3GPP audio/video container video/3gpp ; audio/3gpp if it doesn’t contain video
.3g2 3GPP2 audio/video container video/3gpp2 ; audio/3gpp2 if it doesn’t contain video
.7z 7-zip archive application/x-7z-compressed

Found a content problem with this page?

This page was last modified on Mar 3, 2023 by MDN contributors.

Источник

What is MIME Type for Excel Document ?

MIME (Multipurpose Internet Mail Extensions) is a media type used to identify a type of data on the Internet or by applications. Its name contains the word «Internet» but it is not only limited to the Internet.IANA is in charge of standardizing and disseminating these MIME classifications.

There are numerous popular extensions available among them. One of them is the Excel MIME type.

Please enable JavaScript

1 Type is a logical grouping of many MIME types that are similar to one another. All Excel files have an application as a type.

2 SubType is specific to a single file type within the «type«.They are unique within the «type».Some of the subtypes for excel files are: vnd.ms-excel,vnd.openxmlformats-officedocument.spreadsheetml.sheet,vnd.openxmlformats-officedocument.spreadsheetml.template,vnd.ms-excel.sheet.macroEnabled.12 etc.

There are various MIME types for Excel for various Excel-related files and their extensions such as. xls,.xlsx,.xlt,.xla, and so on.

Let’s look at Excel file MIME Type and extension used by them in table format.

Extension MIME Type (Type / SubType) Kind of Document
.xls application/vnd.ms-excel Microsoft Excel
.xlsx application/vnd.openxmlformats-officedocument.spreadsheetml.sheet Microsoft Excel (OpenXML)
.xltx application/vnd.openxmlformats-officedocument.spreadsheetml.template Office Excel 2007 template
.xlsm application/vnd.ms-excel.sheet.macroEnabled.12 Office Excel 2007 macro-enabled workbook
.xltm application/vnd.ms-excel.template.macroEnabled.12 Office Excel 2007 macro-enabled workbook template
.xlam application/vnd.ms-excel.addin.macroEnabled.12 Office Excel 2007 macro-enabled add-in
.xlsb application/vnd.ms-excel.sheet.binary.macroEnabled.12 Office Excel 2007 non xml binary workbook

fig. various format for saving excel file

Let’s explain them in brief.

1 .xls

.xls is one of the older file extension of Microsoft Excel Spreadsheet.It is created by Excel 97 or Excel 2003. They by default generate .xls format.

MIME Type Supported by .xls file is application/vnd.ms-excel where the application of MIME type and vnd.ms-excel is subtypes and vnd here means vendor-specific which in this case vendor is Microsoft.

If you have an.xls file and want to open it in Excel before prior 2007, you can do so easily because Excel before 2007 recognizes application/vnd.ms-excel and does not require to afford to open it.

Despite the fact that the.xls file format is older, it can be opened in all versions of Excel due to backward compatibility in newer versions.

2 .xlsx

xlsx is the new file extension of the Microsoft Excel Spreadsheet. It is created by Excel 2007 and later versions.

If you create an excel file in Excel 2007 or later, it will be saved with the.xlsx extension by default; however, you can also save the same file in.xls format.xlsx is more secure and better for data storage(ie. smaller file size) than xls.

MIME type for .xlsx file is application/vnd.openxmlformats-officedocument.spreadsheetml.sheet where MIME type is application and subtype is vnd.openxmlformats-officedocument.spreadsheetml.sheet

It is a file format based on Office OPEN XML developed by Microsoft for representing spreadsheets. Because xlsx is an open standard, other software application vendors, such as Google (Google Sheets), can use it to interoperate with their spreadsheet applications.

You can open Xls file in excel 2007 and later and convert them to xlsx and save it.

3 .xltx

Microsoft Excel Template files with the. xltx extensions are based on the Office OpenXML file format specifications. It is used to generate a standard template file that can be used to generate XLSX files with the same settings as the XLTX file.

MIME type for .xlsx file is application/vnd.openxmlformats-officedocument.spreadsheetml.template where MIME type is application and subtype is vnd.openxmlformats-officedocument.spreadsheetml.sheet

It is XML based file format developed by Microsoft for representing templates. An XLTX is identical to an XLSX in every way except that Excel creates a new instance of an XLSX if the file opened is an XLTX.

4 .xlsm

An XLSM file is a macro-enabled spreadsheet created by Microsoft Excel that can also be opened with Google Sheets.XLSM files are based on the Office Open XML format, where the last «m» of an xlsm file extension indicates that the file contains macros.Macros can be stored within an xlsm file, allowing users to automate repetitive tasks.

MIME type for .xlsx file is application/vnd.ms-excel.sheet.macroEnabled.12 where MIME type is application and subtype is vnd.ms-excel.sheet.macroEnabled.12

5 .xlam

An XLAM file extension indicates an Excel Macro-Enabled Add-In file, which is used to provide additional functionality for spreadsheets.
It has the following MIME types:application/vnd.ms-excel.template.macroEnabled.12 where MIME type is application and subtype is vnd.ms-excel.template.macroEnabled.12

Because of the file’s purpose, there is built-in macro support in .xlam files.

6 .xlsb

An XLSB file is an Excel Binary Workbook file that stores data in binary rather than XML format. Because they are stored in binary, the read and write times in xlsb files are faster, and they have been found to be useful for very large and complex spreadsheets for this reason. They are also smaller in size than the XLSM format.

MIME type for .xlsx file is application/vnd.ms-excel.sheet.binary.macroEnabled.12 where MIME type is application and subtype is vnd.ms-excel.sheet.binary.macroEnabled.12

For generating a .xls file in C# code you have to mention application/vnd.ms-excel MIME types in response header as shown below.

For generating a .xls file in C# code you have to mention application/vnd.openxmlformats-officedocument.spreadsheetml.sheet MIME types in response header as shown below.

If you are generating Excel file target to xlsx file then you have to use above.

Ans: xlam is the replacement for the old .xla format.

Источник

Понравилась статья? Поделить с друзьями:
  • File svg in word
  • File rename vba excel
  • File recovery from excel
  • File png a word
  • File path from excel