✓

PRIVATE BROWSER TOOL

Validate Intel HEX checksums and structure

Use this pre-flight check before flashing or merging a firmware image. The report identifies the exact line and expected checksum for each invalid record.

01

Inputs

● Local processing — this file never leaves your browser.
02

Results

✓

Run the tool to see a structured report here.

ON THIS DEVICE

Recent history

Your latest 10 runs will appear here on this device.

HOW IT WORKS

Method and formulas

The least-significant byte of the sum of byte count, address bytes, record type, data bytes and checksum must equal zero.

Accuracy note

Always compare generated firmware with the target device’s memory map, linker output and programming documentation before flashing.

GUIDE

What this tool does and when to use it

Intel HEX files encode firmware or configuration data as a sequence of ASCII records. Each record begins with a colon followed by a byte count, 16-bit address, record type, optional data bytes and a checksum. This validator examines every record for correct hexadecimal syntax, valid record types from 00 to 05, data length between 0 and 255 bytes, strictly increasing addresses within linear segments and correct checksum. The tool runs entirely inside the browser so no file leaves the local machine. Engineers use it after generating HEX output from compilers or converters, before programming microcontrollers or FPGAs, and when merging multiple firmware images. It also helps during reverse engineering when extracted memory dumps must be verified before re-assembly into a valid HEX file.

Worked example with realistic numbers

Consider the record :100000000102030405060708090A0B0C0D0E0F1061. The byte count field is 0x10 indicating sixteen data bytes. The address is 0x0000 and the record type is 0x00 for data. The sixteen data bytes sum to 0x78. Adding the byte count 0x10, address high byte 0x00, address low byte 0x00 and record type 0x00 produces a partial sum of 0x88. The checksum byte 0x61 is chosen so that 0x88 plus 0x61 equals 0xE9 whose least-significant byte is zero after discarding the carry. The table below shows the byte-by-byte breakdown.

FieldHex valueDecimalContribution to sum
Byte count101616
Address high0000
Address low0000
Record type0000
Data bytes sum01..0F120120
Checksum619797
Total233 (LSB 0xE9 mod 256 = 0)

Formula and method table

The validation algorithm follows the standard Intel specification. All input characters must be uppercase or lowercase hexadecimal digits. The sum of the byte count, two address bytes, record type byte, every data byte and the checksum byte must be congruent to zero modulo 256. Record types are restricted to 00 data, 01 end-of-file, 02 extended segment address, 03 start segment address, 04 extended linear address and 05 start linear address. Address sequencing is checked so that each subsequent data record address is greater than or equal to the previous address plus its length within the same linear segment.

Input fieldUnitExpected rangeOutput status
Record length bytebytes0-255Valid or length error
Address field16-bit word0-65535Sequence or wrap error
Record typeenumeration0-5Type error
Data payloadhex byteseven lengthSyntax error
Checksum byte8-bit value0-255Checksum mismatch

Units and conversions notes

Addresses are always expressed as 16-bit values inside each record yet may be extended by type 02 or 04 records to 20-bit or 32-bit linear addresses. Data lengths are counted in bytes not words. All numeric fields use big-endian byte order for the two address bytes. When converting from binary to HEX the tool does not perform any scaling; it only validates the textual representation. End-of-file records must appear exactly once and must contain zero data bytes. Start address records of type 05 are accepted only when the file targets 32-bit processors that use them to set the initial program counter.

Limitations

The validator accepts files up to several megabytes but performance depends on browser JavaScript engine speed. It does not simulate execution or verify that data bytes fall inside valid flash sectors of any specific microcontroller. Extended segment addressing (type 02) is supported yet the resulting 20-bit addresses are not cross-checked against any device memory map. Duplicate addresses within the same linear segment are reported as warnings rather than hard errors because some legacy tools intentionally overwrite locations. The tool never writes to disk or transmits data; all processing occurs in local memory and is discarded when the page is closed.

Common mistakes

Developers often forget that the checksum is the two's complement of the preceding sum, leading to off-by-one errors when manually recalculating. Another frequent issue is supplying lowercase letters that some older parsers reject even though the validator accepts both cases. Record type 04 must be followed by exactly two data bytes representing the upper 16 address bits; supplying four bytes triggers a length error. Address gaps are sometimes introduced by linkers when sections are placed at non-contiguous locations; the validator flags these only if the gap crosses a linear address boundary without an intervening type 04 record. Finally, omitting the terminating end-of-file record causes the validator to report an incomplete file even when every checksum is correct.

LONG-FORM ANSWERS

Frequently asked questions

How does the validator treat a type 04 record that appears after the first data record?

The validator accepts the record but records a warning because linear address changes should precede data records. Subsequent addresses are interpreted relative to the new base until another type 04 record appears.

What happens when a data record length byte is odd?

An odd length byte violates the Intel HEX specification because each record must contain an integer number of bytes. The validator immediately flags a syntax error and stops further checksum evaluation on that line.

Does the tool verify that start-segment address records contain exactly four data bytes?

Yes. Type 03 records must carry exactly four bytes representing the CS:IP pair. Any other length produces a record-length error before checksum validation occurs.

How are overlapping address ranges from multiple type 02 records handled?

The validator treats each segment independently and does not merge or detect overlaps. Users must manually ensure that segment registers produce non-overlapping physical addresses for their target device.

What checksum result occurs if the final sum before the checksum byte equals 0x100?

The required checksum byte becomes 0x00 because 0x100 modulo 256 is zero. The validator accepts this value and reports the record as valid.

Can the validator detect truncated records missing the checksum byte?

Yes. Every record must contain at least eleven characters after the colon. Shorter lines trigger an immediate length error before any arithmetic is performed.

How does the tool respond to record type 05 on a file intended for an 8-bit microcontroller?

The validator accepts the syntax but issues a warning that type 05 records are normally used only with 32-bit processors. The checksum is still verified regardless of target architecture.

What address sequence check is performed across end-of-file records?

End-of-file records must have zero length and appear only once. Any data bytes or duplicate end-of-file records produce a structural error even when the checksum itself is correct.