HEX ELF
File conversion

Convert HEX to ELF

QUICK ANSWER
Is it possible to convert HEX to ELF?
Yes - HEX converts to ELF.

Run avr-objcopy -I ihex -O elf32-avr firmware.hex firmware.elf to produce a valid ELF file. The ELF will disassemble correctly but has no symbol table or DWARF debug sections - those come from the compiler, not the .hex file. Check your build directory first; the compiler likely already created a .elf alongside the .hex.

Also to ELF: FAP · S19

On this page

Tested on macOS, Windows & Linux
Last verified Oct 2026

More free converters

HEIC, PNG, WEBP, MP3 and more - every tool here is free.

Open the toolbox

Why convert HEX to ELF?

Some embedded toolchains and debuggers accept only ELF input, not raw HEX. Wrapping a .hex into .elf lets you load firmware into GDB or flashing utilities that require ELF format, even without a symbol table. The complete ELF with symbols and debug info is produced by the compiler; converting from HEX yields only a stripped shell.

How to convert HEX to ELF

avr-objcopy OPEN-SOURCE

Run avr-objcopy -I ihex -O elf32-avr firmware.hex firmware.elf; replace elf32-avr with the correct target (e.g., elf32-littlearm for ARM Cortex-M). avr-objcopy ships with avr-gcc and is bundled inside the Arduino IDE.

arm-none-eabi-objcopy OPEN-SOURCE

For ARM Cortex-M targets, run arm-none-eabi-objcopy -I ihex -O elf32-littlearm firmware.hex firmware.elf from the GNU Arm Embedded Toolchain.

About these formats

Quality & what to watch

  • The output ELF contains only raw bytes at their target addresses; section names will be generic (e.g., .sec1) rather than the original .text, .data, .bss names assigned by the compiler.
  • If you compiled the firmware yourself, the build directory likely already contains a .elf alongside the .hex - check there before converting.
  • The -O elf32-avr architecture flag must match the actual CPU; using the wrong flag produces an ELF that debuggers or flashers will reject.

Frequently asked questions

Can I recover function names and debug symbols from a HEX file?
No - Intel HEX stores only raw bytes and memory addresses; symbol names, DWARF debug info, and section names are not present.
Where is avr-objcopy on my machine?
It ships with avr-gcc and is bundled inside the Arduino IDE under hardware/tools/avr/bin/; use arm-none-eabi-objcopy for ARM targets.
Will the resulting ELF disassemble correctly?
Yes - the raw bytes and load addresses are intact so disassembly works, but function and variable names will be absent.