BIN ↔ Intel HEX / SREC Converter

Convert firmware images between raw binary, Intel HEX, and Motorola S-record. Validates checksums, preserves sparse address maps, handles linear and segmented Intel HEX addressing, and emits a raw hex preview for inspection.

DomainIoT / ArduinoVersionv1.0.0Added2026-05-19

Convert firmware images between raw binary, Intel HEX and Motorola S-record without firing up a toolchain. It validates record checksums, preserves sparse address maps, handles both linear and segmented Intel HEX addressing, and shows a raw hex preview so you can eyeball the bytes before flashing.

Source
Drop firmware files here
`.bin`, `.hex`, `.ihex`, `.s19`, `.srec`
BIN input is read from the uploaded file. For API usage, the same payload is accepted through `source_base64`.
Result
Upload a firmware file or paste Intel HEX / SREC text to start converting.
POST /v1/iot-arduino/bin-ihex-srec-converterView API docs →
curl -X POST https://toolsamurai.com/api/v1/iot-arduino/bin-ihex-srec-converter \
  -H "Authorization: Bearer sk_live_•••••••••••••••" \
  -H "Content-Type: application/json" \
  -d '{
     "source_format": "bin",
     "target_format": "ihex",
     "source_text": "",
     "source_base64": "AQIDBA==",
     "start_address": 0,
     "record_size": "16",
     "preview_word_size": "1",
     "padding_byte": 255,
     "address_offset": 0,
     "gap_mode": "pad"
  }'
firmwareintel-hexihexsrecbinaryembeddedmcubootloader
How it works

The method behind the numbers

Intel HEX and S-record (SREC) are ASCII container formats that wrap binary data in records carrying an address, a byte count, the payload, and a checksum. Raw BIN has none of that structure — it's just bytes — so converting to or from BIN requires a base address to anchor where the image lives in the device's memory map.

The converter parses every record, verifies its checksum, and rebuilds an internal address-to-byte map. That map can be sparse: real firmware often has gaps between sections, and the gap mode controls whether those gaps are padded with a fill byte (giving a contiguous BIN) or left compact. Intel HEX's extended-address records (segmented and linear) are decoded so images above 64 KB convert correctly, and the chosen record size sets how many payload bytes go in each output line.

Worked examples

See it in practice

BIN → Intel HEX at a flash base address

Wrap a raw image for a bootloader that expects Intel HEX, padding gaps with 0xFF.

source_format
bin
target_format
ihex
start_address
0
record_size
16
preview_word_size
1
padding_byte
255
gap_mode
pad
FAQ

Frequently asked questions

Why do I need a start address for BIN?

Raw binary carries no address information — it's only bytes. Intel HEX and SREC records each state where their data belongs in memory. So converting BIN → HEX/SREC needs you to supply the base address where the image is meant to load.

What does the checksum validation catch?

Each HEX/SREC record ends in a checksum over its bytes. Validating it flags truncated lines, copy-paste corruption, or a file that was edited by hand and no longer adds up — before you flash a bad image to a device.

How are gaps between sections handled?

Firmware images are often sparse. 'Pad' fills the gaps with your chosen padding byte (commonly 0xFF, the erased-flash value) to produce a contiguous binary; 'compact' keeps only the populated regions. Pick pad when the flasher expects a full image, compact when it honours the address map.

Does it handle images larger than 64 KB?

Yes. Intel HEX uses extended segment and extended linear address records to reach beyond 16-bit addressing; the converter decodes both, so multi-segment images above 64 KB round-trip correctly.

Embedding

Embed BIN ↔ Intel HEX / SREC Converter on your site

Sign in to configure the live preview, theme, defaults, locked inputs, and analytics ID from the embed dashboard.