Simple, console-based utility designed to convert HEX (hexadecimal) files to BIN (binary) fast and with listtle effort from the user.
- Hex2bin
- Version :2.4
- License :LGPL
- OS :Windows All
- Publisher :Jacques Pelletier
Hex2Bin is a small, command-line utility that converts Intel HEX files (.hex) to binary files (.bin), commonly used in embedded systems programming and firmware development.
πΉ What Is Hex2Bin?
- π Converts
.hex(Intel Hex) files β.bin(raw binary) files. - βοΈ Useful when working with:
- Microcontrollers (AVR, PIC, ARM, etc.)
- Flashing tools that require
.binformat - Embedded firmware development workflows
- β Licensed under GPL
- π₯οΈ Runs on Windows, and can be built for Linux (source code available)
π» Download Hex2Bin
π Official page: http://sourceforge.net/projects/hex2bin/
Steps:
- Go to the Files section:
https://sourceforge.net/projects/hex2bin/files/ - Download the latest version (usually a
.zipfile likehex2bin-2.5.zip). - Extract it to a folder.
β Itβs portableβno installation needed.
πΉ How to Use Hex2Bin
βοΈ Basic Command Syntax
Open a Command Prompt and run:
hex2bin yourfile.hex
This will produce:
yourfile.bin
in the same folder.
β Optional Parameters
You can use extra options:
hex2bin yourfile.hex -o output.bin -l 0x0000 -h 0x7FFF
| Option | Description |
|---|---|
-o | Specify output filename |
-l | Start address (lower address) |
-h | End address (upper address) |
-p | Pad unused areas with a byte (e.g. 0xFF) |
-v | Verbose output |
π Example
hex2bin firmware.hex -o firmware.bin -p FF -v
This will:
- Output as
firmware.bin - Pad empty space with
0xFF - Show verbose messages
π§ͺ Verifying Output
- Use a hex editor (e.g., HxD, Bless, GHex) to inspect the binary file.
- You can also compare sizes and addresses if using a flashing tool.
π Reverse Operation?
Hex2Bin is only for hex β bin.
If you need bin β hex, use tools like:
srec_catfrom the SRecord projectobjcopyfrom GNU binutils- Dedicated flashing tools that export
.hex
π§ Troubleshooting
- “No data in file” error β Your hex file may be empty or malformed.
- Binary file too large/small β Set proper address limits with
-land-h. - Not recognized as command β Make sure youβre in the directory or add it to PATH.
π¦ Alternative Tools
If you need more functionality, try:
- srec_cat (supports Intel HEX, Motorola S-Record, binary, etc.)
- objcopy (from GNU toolchain)
- Bin2Hex/Hex2Bin GUI tools
