SREC (file format)

The Motorola S-Record format is an ASCII-based data format for encoding binary files. It is also known as SREC or S19 format. It is mainly used for storing program code of microcontrollers in embedded systems. It was developed 6800 microprocessor in the 1970s for the Motorola.

A similar, though slightly different format is the Intel HEX format, which among other things for Intel processors used.

The ASCII encoding allows editing or opening the file with a text editor. Since it contains checksums, bad records can be detected in a transmission.


An S -record file consists of a series of ASCII data sets (English Records). All hexadecimal numbers are big endian, that is, the most significant byte is stored first, so on the smaller address. The records have the following structure:

There were some programs in an S-Record limited the number of characters for compatibility with teletypes to 56 printable characters. A UNIX manual page writes from a limit of 78 printable characters. Since no limit is defined by Motorola, a program should also work with a byte count of 255, ie, with 514 printable characters plus -terminating, can handle.

There are eight types of records listed below:

  • The S0 header contains no program data but vendor-specific data. The data field is structured as follows: Module name (20 characters)
  • Version (2 characters)
  • Revision ( 2 characters)
  • Description ( 0-36 characters)


S00F000068656C6C6F202020202000003C S11F00007C0802A6900100049421FFF07C6C1B787C8C23783C6000003863000026 S11F001C4BFFFFE5398000007D83637880010014382100107C0803A64E800020E9 S111003848656C6C6F20776F726C642E0A0042 S5030003F9 S9030000FC Start code Record type ( record type ) byte count address data Checksum ( checksum)

The checksum for the first data sample is calculated as follows: .

Related file formats

Very similar is the Intel HEX format ( also briefly Intel HEX). In addition, there are also other formats, such as the simple binary code or the JEDEC format for this application.