What’s BinHex?

Print anything with Printful



BinHex is a file encoding technique used to convert binary files into text format for transmission over networks. It was developed in 1981 by Tim Mann for TRS-80 computers and later improved by Yves Lempereur for Macintosh files. The original method uses 8-to-4 encoding, while later versions use 8-to-6 encoding. BinHex also includes an archiving technique to handle the two-part nature of early Macintosh files. The final version, with the .hqx suffix, includes error checking and only uses characters that won’t be translated during decoding.

BinHex is a method used in computer science to convert a binary file into a text format so that it can be transmitted over a network. This is an older file encoding technique, devised as a means to help deal with early computer network communication protocols that were incapable of transmitting binary data. Files converted this way will have one of three possible filename suffixes: .hex, .hcx, or .hqx, depending on the version. However, the text of the encoded file is readable in a plain text viewer and the BinHex version decoding requirement is displayed in the first line of the file.

The first BinHex coding technique was developed in 1981 to address the then-common practice in which the data transferred over communication channels were American Standard Code for Information Interchange (ASCII) text characters. This early implementation was devised by Tim Mann and used on the TRS-80® personal computers of the early 1980s. When the Apple® Macintosh computer emerged, the technique was ported to work with Macintosh® files and was further developed by a man named Yves Lempereur, which improved encoding speed and compression.

Basically, the original BinHex encoding method takes groups of four binary digits, or bits, in a binary file and represents them as a single hexadecimal digit, which are the numbers 0 through 9 and the letters A through F. Each hexadecimal digit it can then be paired with one another and encoded as an ASCII text character. This is sometimes referred to as 8-to-4 encoding, because the process uses eight bits to represent four. Naturally, this makes the encoded .hex file much larger than its original binary counterpart, but plain text can also be split into separate files for transmission.

The BinHex encoding method also created an archiving technique, or encapsulation, to handle the two-part nature of the early Apple® Macintosh® file format. These files had two main components: a resource fork and a data fork. With a BinHex encoding, both Macintosh® file forks would be encapsulated in the encoding, allowing the receiving end to decode the entire file. As a result, the encoding method became the primary storage and transmission format on Macintosh® computers of the 1980s and 1990s.

After establishing its foothold on the Macintosh®, the BinHex technique needed improvement. A second version was developed that no longer used hexadecimal encoding, instead implementing an 8 to 6 encoding technique, which reduced the size of the encoded file by half. These new compact files, while no longer technically hexadecimal in nature, still retained the BinHex naming format, although they changed the file extension to .hcx. However, this method had problems with computer systems that used non-English characters, whereby the file was corrupted during the decoding process as some characters were translated.

The final version of BinHex fixed these problems by only using characters that would not be translated automatically when decoding. The coding method also included additional error checking techniques which ensured against any unwanted changes to the text. These more stable encoded files were then assigned the .hqx suffix, but still retained the compression of their .hcx predecessors.




Protect your devices with Threat Protection by NordVPN


Skip to content