What is MIME type "application/mac-binhex"?

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

application/mac-binhex encodes binary files as text. It was designed to transfer Mac files over networks that support only text. This keeps the file content and metadata intact.

Data is converted using the BinHex algorithm. That means the file data is restructured into an ASCII format.

Key points include:

Files using this MIME type often carry extensions like HEX, HQX, and HCX. These links give more details for each extension.

This MIME type was popular before modern binary transfers. Now, many systems can send real binary data. However, application/mac-binhex remains useful when working with older Mac files.

For more specific details, consider reading technical resources on BinHex.

Associated file extensions

Usage Examples

HTTP Header

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


    Content-Type: application/mac-binhex    
  

HTML

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


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

Associated file extensions

FAQs

How do I open a file sent as application/mac-binhex?

You need a decompression utility like The Unarchiver (macOS) or StuffIt Expander (Windows/Mac). Since application/mac-binhex is a legacy encoding method, modern operating systems do not automatically decode these files without third-party software. The file usually converts into a usable application or document after decoding.

Why does my browser display the file as garbled text instead of downloading?

The server is likely sending the file with a text/plain header because BinHex files contain ASCII characters. To fix this, the server administrator must configure the MIME type to application/mac-binhex. As a user, you can right-click the link and select Save Link As... to download the .hqx file manually.

How do I configure Apache to serve .hqx files correctly?

Add the AddType directive to your .htaccess file or the main server configuration. Use the line AddType application/mac-binhex .hqx. This ensures that visitors download the file properly instead of viewing the raw encoded text in the browser window.

Is application/mac-binhex still used in modern web development?

No, it is primarily a legacy format used for archiving vintage Macintosh software. Modern web transfers handle binary data safely without needing text encoding. You should generally use standard compression formats like ZIP unless you are specifically targeting classic Mac OS users.

How do I add support for this MIME type in Nginx?

Locate your mime.types file, typically found in /etc/nginx/. Add the line application/mac-binhex hqx; inside the types { } block. Restart Nginx to apply the changes, ensuring that files with the .hqx extension are served with the correct headers.

What is the difference between application/mac-binhex and MacBinary?

BinHex encodes files as 7-bit ASCII text, making it safe for email bodies and legacy text-only protocols. MacBinary (application/x-macbinary) keeps the file in a binary format. While both preserve the Mac resource fork, BinHex is more robust against corruption during transfer over older networks.

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.