What is MIME type "chemical/x-mdl-molfile"?

A MIME type is a string that tells browsers and other tools how to handle a particular kind of file.

Chemical/x-mdl-molfile is a MIME type for files containing chemical structure data. It uses a fixed, text-based format to store details about atoms, bonds, and connectivity. MDL Molfile is the standard that defines this structure.


This format is key in chemistry software. It makes it easy to visualize, share, and analyze molecular structures across different programs.



Files using this MIME type typically have the MOL extension. The defined structure ensures that detailed molecular information is exchanged in a consistent way. For more details on the format, see the Molfile article on Wikipedia.

Associated file extensions

Usage Examples

HTTP Header

When serving content with this MIME type, set the Content-Type header:


    Content-Type: chemical/x-mdl-molfile    
  

HTML

In HTML, you can specify the MIME type in various elements:


    <a href="file.dat" type="chemical/x-mdl-molfile">Download file</a>    
  

Server-side (Node.js)

Setting the Content-Type header in Node.js:


    const http = require('http');    
    
    http.createServer((req, res) => {    
      res.setHeader('Content-Type', 'chemical/x-mdl-molfile');    
      res.end('Content here');    
    }).listen(3000);    
  

Associated file extensions

FAQs

How do I configure Apache or Nginx to serve .mol files correctly?

To serve these files with the correct headers, you must map the extension to the MIME type. For Apache, add AddType chemical/x-mdl-molfile .mol to your configuration or .htaccess file. For Nginx, include chemical/x-mdl-molfile mol; within your mime.types file or types block.

Can web browsers render chemical/x-mdl-molfile data natively?

No, standard web browsers (Chrome, Firefox, Edge) display the file as plain text or prompt a download by default. To render the 3D or 2D structure directly in a webpage, developers typically use JavaScript libraries like JSmol, 3Dmol.js, or ChemDoodle Web Components.

What software opens files with the chemical/x-mdl-molfile type?

Specialized cheminformatics software is required to visualize the structure, such as ChemDraw, Avogadro, or Biovia Draw. However, because the format is text-based, you can open a .mol file in any text editor (like Notepad) to inspect the raw atom and bond data.

Why does this MIME type include an "x-" prefix?

The x- prefix in chemical/x-mdl-molfile signifies that it is a non-standard or private subtype, not officially registered with IANA as a primary standard. Despite the prefix, it is widely accepted as the de facto standard for chemical data exchange on the web.

What is the difference between chemical/x-mdl-molfile and chemical/x-mdl-sdfile?

A Molfile (.mol) describes a single molecule's structure. In contrast, an SDFile (.sdf) is a container format that can hold multiple molfiles along with associated data fields, making it better suited for chemical databases.

Is the chemical/x-mdl-molfile format binary or text-based?

It is a strictly text-based format. The file adheres to the MDL Molfile specification, which uses a connection table (C-tab) to list atoms, coordinates, and bond connections in a fixed-width ASCII layout.

General FAQ

What is a MIME type?

A MIME (Multipurpose Internet Mail Extensions) type is a standard that indicates the nature and format of a document, file, or assortment of bytes. MIME types are defined and standardized in IETF's RFC 6838.

MIME types are important because they help browsers and servers understand how to process a file. When a browser receives a file from a server, it uses the MIME type to determine how to display or handle the content, whether it's an image to display, a PDF to open in a viewer, or a video to play.

MIME types consist of a type and a subtype, separated by a slash (e.g., text/html, image/jpeg, application/pdf). Some MIME types also include optional parameters.

How do I find the MIME type for a file?

You can check the file extension or use a file identification tool such as file --mime-type on the command line. Many programming languages also provide libraries to detect MIME types.

Why are multiple MIME types listed for one extension?

Different applications and historical conventions may use alternative MIME identifiers for the same kind of file. Showing them all helps ensure compatibility across systems.