Site Map - skip to main content

Hacker Public Radio

Your ideas, projects, opinions - podcasted.

New episodes Monday through Friday.

hpr4011 :: The Intel Hex file format

A synopsis of this old but far from dead file format

<< First, < Previous, , Latest >>

Hosted by Brian in Ohio on 2023-12-18 is flagged as Clean and is released under a CC-BY-SA license.
hobby electronics, retrocomputing, espeak. (Be the first).

Listen in ogg, spx, or mp3 format. Play now:

Duration: 00:02:17



an example intel hex file with 1 record containing 3 data bytes (02h 33h 7ah) and an end of file marker:


espeak incantation:

espeak-ng -v mb-us3 -s 163 -p 38 -f -w intel-hex.wav

Hello Hacker Public Radio, Brian in Ohio here. I am out from under my rock and this episode is about an old file format that despite its age is still in use in many places today.

That format is the Intel Hex format. What is this format? Glad you asked.

From the book of knowledge we read,

Intel hexadecimal object file format, Intel hex format or Intellec Hex is a file format that conveys binary information in ASCII text form.

If you have ever programmed an arduino board the file that is used to program the board.

The file generated by the arduino eye dee eee is an intel hex file.

The format consists of any number of lines, called records.

Intel HEX consists of lines of ASCII text that are separated by line feed or carriage return characters or both.

Each text line contains uppercase hexadecimal characters that encode multiple binary numbers.

The binary numbers may represent data, memory addresses, or other values, depending on their position in the line and the type and length of the line.

Each text line is called a record.

A record consists of six fields that appear in order from left to right

  1. Start code, one character, an ASCII colon.
  2. Byte count, indicating the number of bytes in the data field.
  3. Address, four hex digits, representing the 16-bit beginning memory address offset of the data.
  4. Record type two hex digits, 00 to 05, defining the meaning of the data field.
  5. Data, a sequence of bytes of data
  6. Checksum, a computed value that can be used to verify the record has no errors.

An end of file record must occur exactly once per file in the last record of the file. The byte count is 00, the address field is typically 0000 and the data field is omitted.

A record's checksum byte is the two's complement of the least significant byte of the sum of all decoded byte values in the record preceding the checksum.

It is computed by summing the decoded byte values and extracting the least significant byte of the sum, and then calculating the two's complement of the sum, by inverting its bits and adding one.

I have included in the show notes an example of a record with pipes used to break up the line.

Hope you enjoyed the espeak episode.

There are so many ways to produce shows, there is no excuse not to!

This is Brian in Ohio signing off reminding everyone.

We are all creatures of ego.


Subscribe to the comments RSS feed.

Leave Comment

Note to Verbose Commenters
If you can't fit everything you want to say in the comment below then you really should record a response show instead.

Note to Spammers
All comments are moderated. All links are checked by humans. We strip out all html. Feel free to record a show about yourself, or your industry, or any other topic we may find interesting. We also check shows for spam :).

Provide feedback
Your Name/Handle:
Anti Spam Question: What does the P in HPR stand for ?