What is MIME type "application/mathematica"?

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

application/mathematica identifies files created by Wolfram Mathematica. These files hold interactive notebooks that combine code, text, and graphics.
They let systems know that the file is not plain text but a structured document meant for computation and visualization.
Files using this MIME type come in various formats such as MB, NB, and MA.
For more details on Mathematica files and their use, visit the Wolfram Mathematica site.

Associated file extensions

Usage Examples

HTTP Header

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


    Content-Type: application/mathematica    
  

HTML

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


    <a href="file.dat" type="application/mathematica">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', 'application/mathematica');    
      res.end('Content here');    
    }).listen(3000);    
  

Associated file extensions

FAQs

What software is required to open files with the application/mathematica MIME type?

Files served with this MIME type, most commonly .nb files, are designed to be opened with Wolfram Mathematica or the free Wolfram Player. These documents contain interactive code and mathematical notation that standard text editors cannot render correctly.

How do I configure an Apache server to serve Mathematica notebooks?

To ensure browsers handle the file correctly instead of displaying it as plain text, add the following line to your .htaccess file or main configuration: AddType application/mathematica .nb .ma .mb. This tells the server to associate the MIME type with the specific extensions.

Why does my browser display the Mathematica file as raw code instead of downloading it?

If the server is misconfigured, it may send the file as text/plain. To fix this, ensure the web server sends the application/mathematica header. As a user, you can right-click the link and select Save Link As to download the NB file manually.

Can I view application/mathematica files directly in a web browser?

Most modern browsers (Chrome, Firefox, Edge) do not natively render Mathematica notebooks. They will usually prompt you to download the file. However, files can be viewed online without installation using the Wolfram Cloud platform.

How do I set up Nginx to handle Mathematica file extensions?

You should edit your mime.types file or the types block in your Nginx configuration. Add the line application/mathematica nb ma mb; to ensure the server delivers the correct content type header to the client.

Is application/mathematica safe to open?

These files often contain executable code that runs immediately upon evaluation. You should only open MA or .nb files from trusted sources, or open them in a "sandbox" mode if your security settings allow, to prevent malicious scripts from executing.

What is the difference between .nb and .cdf files?

While .nb files (Notebooks) often use application/mathematica, .cdf (Computable Document Format) files use application/vnd.wolfram.cdf. Notebooks are generally for authoring and development, while CDFs are intended for deployment and viewing with the free player.

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.