File Formats
  • Audio
  • Video
  • Images
  • 3D & CAD
  • Documents
  • Data
  • Code
  • System
Code
  • Source code
  • Bytecode
  • Programs & libraries
  • Object files
  • Debug info
  • Firmware & ROMs
  • Notebooks
  • Shaders
  • Build files
  • Packages & installers
  1. Home
  2. Code
  3. Firmware & ROMs
  4. HEX
.HEX
  • Overview

.HEX

Intel HEX firmware

Introduction

Intel HEX is a text format for binary data that is to be written into memory, most often the firmware for a microcontroller. Each line is one record: a run of bytes, written as hexadecimal digits, with the address they belong at and a checksum. Because it is plain text with addresses, a HEX file can describe memory with gaps in it and survive being sent over links that only carry text.

Toolchains for AVR, PIC, ARM Cortex-M and many other chips produce it. The SDCC compiler names its output .ihx.

Software

  • Arduino IDE, which builds and uploads them (Windows, macOS, Linux)
  • AVRDUDE (Windows, macOS, Linux)
  • STM32CubeProgrammer (Windows, macOS, Linux)
  • GNU Binutils, whose objcopy converts to and from binary (Windows, macOS, Linux)
  • SRecord (Windows, macOS, Linux)

Structure

Every record is one line that starts with a colon. After it come pairs of hexadecimal digits: the number of data bytes, a 16-bit address, the record type, the data bytes and a checksum. The checksum is chosen so that all the bytes of the record, added together, come to zero in their lowest eight bits.

Six record types exist. Type 00 is data and 01 marks the end of the file. Because a record address is only 16 bits, types 02 and 04 set an upper part that applies to the records after them, giving 20-bit or 32-bit addresses. Types 03 and 05 give the start address.

:10010000214601360121470136007EFE09D2190140
:100110002146017E17C20001FF5F16002148011928
:00000001FF
Two 16-byte data records at 0x0100 and 0x0110, then the end-of-file record.
  1. 0start code :1 character
  2. 1byte count, the number of data bytes2 digits
  3. 3address4 digits
  4. 7record type: 00 data, 01 end, 02 to 05 addresses2 digits
  5. 9data2 digits per byte
  6. …checksum2 digits
One Intel HEX record, by character position.
© 2026 fileformats.org About Contact Made by Lewpen