BinHex Info      Page Info


BinHex Info

General Info

BinHex encoding converts an 8-bit file into a 7-bit format, similar to uuencoding. BinHex format preserves file attributes, as well as Macintosh resource forks, and includes CRC (Cyclic Redundancy Check) error-checking. This encoding method works on any type of file, including formatted word processing and spreadsheet files, graphics files, and even executable files (i.e. programs or applications). The encoded file can also be passed from computer to computer in its encoded form. The encoding will remain intact and it will be equally meaningless on all the machines until it is unencoded. To be usable or readable it must be converted back to its original format and be run on a compatible computer.

Note: This is not to be confused with MacBinary encoding, which is an 8-bit format.
(By the way, the MIME type Base64 is a 6-bit format! Isn't math fun?)


What it looks like

Here is a sample of what BinHex actually looks like:
(This file must be converted with BinHex 4.0)

Note that all lines other than the header and the last line are exactly 64 characters long (not counting the newline characters). If you receive a file in email containing lines of varying lengths, then someone's mail system may have damaged the file and you'll probably need to have it resent.

The line "(This file must be converted with BinHex 4.0)" is an integral part of the file format; in fact, if it is missing or even altered in any way, the file may not get recognized as binhex by a decoder program (not a problem for StuffIt Expander, though). Note also that this does not mean you need a program called "BinHex 4.0" to decode a BinHex file; there are several utilities which can do the trick, the most popular of which are listed on this very page (the page you are reading right now).

Here is some C source code to un-HQX in Unix, the readme from macutil, Pascal source code [ftp_file] of DeHQX 2.0 by Peter Lewis (a great set of code and a good "standard" to follow), and some notes from Yves himself.


BinHex versus MIME

Uh-oh, flamebait! Dare I even attempt to tackle this issue? Actually, there is more than one issue here: we've got email attachments, archive file formats, available source code, level of complexity, and varying implementations regardless of platform. Hmm, I'll leave this alone for now; eventually I'll fill this space up with comparison tables, URLs, and scary stuff like that! In the meantime, the fact is that BinHex is ubiquitous and won't be disappearing anytime soon, so whether it is "preferred" or not is, for the most part, a moot point.

Also, Microsoft has chosen to use the BinHex format as a wrapper for Macintosh ActiveX controls. Apple has specified that Sherlock plug-in updates be posted on web sites in BinHex.

See also TidBITS: Macintosh Internet File Format Primer.


Macintosh Utilities


DOS/Windows Utilities


Unix Utilities

(Info provided by John Gianni,

Many Sparc un-binhexing utilities exist. I think most, if not all, are listed on archie servers (telnet; login as "qarchie"; run the command, "prog binhex"; type "mail yourLogin" to get the report; type "quit" to exit).

rdbinhex (script to automate unbinhexing and conversion to UNIX)


Amiga Utilities

MacTools v2.01b1 will decode BinHex files on the Amiga platform. On Genie, this file can be found in the Amiga RT library, file #19368. (It's probably also on Aminet...) Info provided by Mike Webb (page devoted to the Amiga, Texas Instruments TI-85 calculators, and music...for now - also soon to be the home of a new online Amiga magazine).


Apple ][ Utilities

From Harold.H on Genie:
No BinHex utils that I know of that have been released. I've been trying to find time to write one though :)
Wait... GSCII+ (a IIgs desk accs) handles BinHex, but it's not exactly stable


This page was mentioned in a Macworld magazine column, Parcel Post--Internet-Style (April 1996 issue, page 122, sidebar "Web Worthy"). :-)

[Hand-coded in Tex-Edit Plus] [MacOS] PC Webopaedia Outstanding Page Award

Please choose a menu item before pressing the Go button.

Info:    Site Maps   About Us   Site Info 
Actions:  Search   Communicate   Download 

<URL:> (page info) (c) 1995-2012 Walter Ian Kaye