PRIVATE BROWSER TOOL
View and validate Motorola S-record files
The viewer recognizes S0-S9 records, validates byte counts and checksums, then reconstructs all S1, S2 and S3 data addresses.
Inputs
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 count byte covers address, data and checksum bytes. The low byte of their sum must equal 0xFF because S-record uses the one’s complement of the sum.
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
The SREC S19 viewer and validator parses Motorola S-record files including S19, S28, S37 and MOT variants used for firmware distribution on legacy microcontrollers. It displays record type, address field length, data payload length and verifies the one’s-complement checksum for every line. Engineers employ the tool during firmware release checks, when migrating code between toolchains or when confirming that a received file matches the original memory map before device programming. The utility runs entirely inside the browser so no data leaves the local machine. Additional use cases include post-build verification in continuous-integration pipelines, recovery of corrupted archives from older EPROM programmers, and educational demonstrations of checksum mathematics in embedded-systems courses. Because the parser operates locally, it remains suitable for air-gapped engineering workstations where external upload of proprietary firmware is prohibited.
Worked example with realistic numbers
Consider this S1 record that loads 16 bytes at address 0x0000: S1130000A1B2C3D4E5F60708090A0B0C0D0E0F1055. The count byte is 0x13 indicating 19 total bytes after the type field. Address occupies two bytes, followed by sixteen data bytes and one checksum byte. Summing count plus address plus data produces 0xAA; the one’s complement is 0x55, matching the final byte and confirming validity. A second record S9030000FC terminates the file with a three-byte address field set to zero.
| Field | Hex value | Decimal | Bytes |
|---|---|---|---|
| Type | S1 | — | 2 |
| Count | 13 | 19 | 1 |
| Address | 0000 | 0 | 2 |
| Data | A1B2C3D4E5F60708090A0B0C0D0E0F10 | — | 16 |
| Checksum | 55 | 85 | 1 |
Second worked example
A 24-bit S2 record writes eight bytes starting at address 0x123456: S20B1234560102030405060708E9. Count byte 0x0B signals eleven bytes follow. Three address bytes, eight data bytes and one checksum produce an intermediate sum of 0x17; one’s complement yields 0xE8. The supplied checksum 0xE9 differs by one, revealing a transcription error. Correcting the final byte to E8 restores validity. This example illustrates how address width directly affects checksum arithmetic and why the validator must inspect record type before summation begins.
Formula and method table
| Input | Unit | Operation | Output |
|---|---|---|---|
| Count byte | hex | Sum all bytes after type | intermediate total |
| Address bytes | hex | Add to total | running sum |
| Data bytes | hex | Add to total | final sum |
| One’s complement of low byte | hex | 0xFF minus (sum & 0xFF) | expected checksum |
Units and conversions notes
Address fields are expressed in hexadecimal bytes and interpreted as big-endian integers. S1 records use two address bytes (16-bit), S2 records use three bytes (24-bit) and S3 records use four bytes (32-bit). Data lengths are limited to 255 minus address length minus one checksum byte, producing a practical maximum of 252 data bytes per record. All numeric displays remain in hexadecimal unless the user requests decimal conversion of start and end addresses for memory-range verification. The following table expands common unit relationships encountered when inspecting S-record headers and payloads.
| Quantity | Typical unit | Conversion rule | Example value |
|---|---|---|---|
| Address width | bytes | 2/3/4 per record type | S3 = 4 bytes |
| Maximum data | bytes | 252 − address width | S1 yields 252 |
| Checksum modulus | 256 | Always 8-bit wrap | 0xFF mask |
| Line length | characters | 2 × byte count + 4 | 44 chars for S113 |
| Memory span | bytes | End − start + 1 | 0x0000–0xFFFF = 65536 |
Limitations
The validator confirms only checksum correctness and record syntax; it does not simulate execution or detect overlapping memory ranges across multiple files. Files larger than roughly 50 MB may exceed browser memory limits and are rejected. S0 header records containing ASCII text are displayed but not checksum-validated because some legacy generators omit the checksum on S0. Termination records S7, S8 and S9 are accepted yet their address fields are not cross-checked against the highest data address. The tool also ignores vendor-specific extensions such as optional comments after the checksum and does not decompress run-length-encoded payloads occasionally found in automotive flash files. Finally, it provides no facility for merging multiple S-record sets or for generating patch overlays.
Common mistakes
- Omitting the count byte when manually recalculating checksums leads to off-by-one errors.
- Assuming every record uses a two-byte address; S2 and S3 files require three or four bytes and produce incorrect sums if truncated.
- Confusing the one’s-complement rule with two’s-complement arithmetic, which yields a checksum off by one.
- Submitting files that contain Windows line endings (CRLF) without stripping the carriage-return characters first, causing the parser to treat the extra byte as part of the checksum.
- Expecting the tool to reorder records; out-of-sequence addresses are reported but left unchanged.
- Copying data bytes from a hex editor that inserts spaces between pairs, thereby shifting the checksum calculation by one byte.
- Neglecting to verify that the final termination record address matches the highest data address written, allowing silent truncation during device programming.
LONG-FORM ANSWERS
Frequently asked questions
How does the validator treat an S2 record whose three-byte address exceeds 0xFFFFFF?
The parser rejects the line because the address field length is fixed by record type; any value requiring more than 24 bits triggers an immediate format error before checksum evaluation begins.
What checksum result appears when a record contains exactly 252 data bytes?
The count byte becomes 0xFF, the maximum legal value; the validator sums all 255 bytes after the type field and confirms the one’s complement equals the final byte, provided the file was generated correctly.
Does the tool flag overlapping address ranges between separate S19 files?
No, each file is processed independently; users must load multiple files sequentially and manually compare the reported start and end addresses to detect overlaps.
Can S0 records with odd-length ASCII text be validated?
The tool displays S0 content but skips checksum verification because many legacy tools emit S0 lines without a correct checksum byte.
How are 32-bit addresses from S3 records converted for display?
The four address bytes are concatenated into a single 32-bit hexadecimal value and shown with leading zeros preserved; decimal conversion is available on request.
What occurs if the low byte of the byte sum equals zero?
The required checksum becomes 0xFF; any other value indicates corruption and the record is marked invalid with the calculated versus supplied checksum shown side-by-side.
Are Windows CRLF line endings stripped automatically before parsing?
The parser removes carriage-return characters on the fly so files saved on Windows systems validate identically to Unix-generated equivalents.
Does the validator support S5 record count verification?
S5 records are accepted and their 16-bit count field is compared against the number of preceding data records; mismatches are reported without halting further processing.