IoT / Arduino · Tool

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.

EndpointPOST /v1/iot-arduino/bin-ihex-srec-converterVersionv1.0.0Added2026-05-19

Inputs

source_formatenumSource Format
default "bin" · one of: bin, ihex, srec
BIN reads from source_base64. Intel HEX and SREC read from source_text.
target_formatenumTarget Format
default "ihex" · one of: bin, ihex, srec
The browser UI adds file upload and download on top of this same API contract.
source_textstringSource Text
default ""
Paste Intel HEX or Motorola SREC text here when source_format is ihex or srec.
source_base64stringSource Binary (Base64)
default ""
Base64-encoded binary payload when source_format is bin.
start_addressinteger (addr)Start Address
min 0 · max 2147483647 · default 0
Memory address where a raw BIN image starts.
record_sizeenumRecord Size
default "16" · one of: 4, 8, 16, 32
Bytes per Intel HEX or SREC data record.
preview_word_sizeenumPreview Word Size
default "1" · one of: 1, 2, 4
Groups the raw hex preview as bytes, 16-bit words, or 32-bit words.
padding_byteinteger (0-255)Padding Byte
min 0 · max 255 · default 255
Fill byte used when exporting sparse address maps to BIN with gap_mode = pad.
address_offsetinteger (addr)Address Offset
min -2147483647 · max 2147483647 · default 0
Shift all addresses before serialising the target format.
gap_modeenumBIN Gap Handling
default "pad" · one of: pad, compact
pad keeps original addresses by filling gaps. compact concatenates segments and drops absolute gaps.

Outputs

output_formatstringOutput Format
checksum_validbooleanChecksums Valid
total_input_bytesinteger (bytes)Input Bytes
output_size_bytesinteger (bytes)Output Size
segment_countintegerSegments
address_rangestringAddress Range
segment_summarystringSegment Map
warningsstringWarnings
hex_previewstringHex Preview
target_textstringConverted Text
target_base64stringConverted Binary (Base64)

Example request

curl -X POST https://toolsamurai.com/api/v1/iot-arduino/bin-ihex-srec-converter \
  -H "Authorization: Bearer sk_free_•••••••••••••••" \
  -H "Content-Type: application/json" \
  -d '{
       "source_format": "bin",
       "target_format": "ihex",
       "source_text": "",
       "source_base64": "",
       "start_address": 0,
       "record_size": "16",
       "preview_word_size": "1",
       "padding_byte": 255,
       "address_offset": 0,
       "gap_mode": "pad"
     }'

Example response

200 OK
{
  "ok": true,
  "tool": "bin-ihex-srec-converter",
  "domain": "iot-arduino",
  "version": "1.0.0",
  "result": {
    "output_format": "…",
    "checksum_valid": true,
    "total_input_bytes": ,
    "output_size_bytes": ,
    "segment_count": ,
    "address_range": "…",
    "segment_summary": "…",
    "warnings": "…",
    "hex_preview": "…",
    "target_text": "…",
    "target_base64": "…"
  },
  "meta": { "latency_ms": , "request_id": "req_…" }
}

Tags

firmwareintel-hexihexsrecbinaryembeddedmcubootloader