How to Convert BIN to HEX (Hex Dump and Intel HEX)

Got a .bin file right now?

Open it free in your browser. See the real file type, hex, text and preview in seconds. Nothing is uploaded.

Open your BIN file

Want to see a BIN file as hexadecimal? Maybe you are checking firmware, comparing two files, or a forum post told you to “post the hex”. You need to convert BIN to HEX.

There are two meanings here, and people mix them up. One is a hex dump, a readable view of every byte. The other is the Intel HEX format, a special text format used to program chips. This guide covers both, starting with the one most people need.

What hexadecimal is, in one minute

A byte is a number from 0 to 255. Writing it in normal numbers takes up to three digits, and the width changes. Hexadecimal, or hex, uses 16 symbols: 0 to 9, then A to F. Every byte fits in exactly two hex digits, from 00 to FF.

A few examples:

  • 0 is 00
  • 10 is 0A
  • 65 is 41, which is also the letter “A” in text
  • 127 is 7F
  • 255 is FF

Because every byte is always two characters, hex lines up neatly in columns. That makes it the standard way to show binary data.

Method 1: View BIN as hex online

The fastest way is our free BIN file opener. It works in any browser and never uploads your file.

  1. Open the tool and drop in your .bin file.
  2. The “Hex view” tab opens by default.
  3. Each row shows the offset, 16 bytes in hex and the same bytes as text.
  4. Use the page buttons to move through the file, or “Go to offset” to jump to a position like 0x1000.
  5. Use “Find next” to search for text or a hex pattern like 4D 5A.

Zero bytes show in a lighter color, so empty areas stand out. Search matches are highlighted in both columns.

Method 2: Save a hex dump as a file

To keep the hex or share it, export it.

  1. In the tool, open “Convert & save”.
  2. Click “Download hex dump”.
  3. You get a .txt file with offset, hex and ASCII columns, covering up to the first 16 MB.

This format is the same classic layout used by most hex tools, so others can read it easily.

Method 3: Use built-in commands

Windows

Open PowerShell and run:

Format-Hex -Path C:\path\file.bin | Out-File hex.txt

Windows also has certutil -encodehex file.bin hex.txt, which writes a hex dump in a slightly different layout.

Mac and Linux

xxd file.bin > hex.txt makes a classic dump.

xxd -p file.bin > hex.txt makes plain hex with no offsets or text, just a long string of hex digits. This is handy for pasting into code.

hexdump -C file.bin > hex.txt gives a layout like ours, with ASCII at the side.

How to read a hex dump

Take this line as an example:

00000000 89 50 4E 47 0D 0A 1A 0A 00 00 00 0D 49 48 44 52 .PNG........IHDR

  • 00000000 is the offset. This row starts at byte zero.
  • 89 50 4E 47 are the first four bytes. 50 4E 47 spell PNG. This is the PNG signature.
  • The gap in the middle splits the row into two groups of eight bytes, which makes counting easier.
  • .PNG……..IHDR is the text column. Bytes that are not printable letters show as dots.

The next row would start at 00000010, which is 16 in normal numbers. Each row adds 10 in hex. Our guide on viewing binary files has more reading tips.

Useful hex patterns to know

  • FF D8 FF is the start of a JPEG photo.
  • 25 50 44 46 is %PDF, the start of a PDF.
  • 50 4B 03 04 is PK, the start of a ZIP.
  • 4D 5A is MZ, the start of a Windows program.
  • 00 FF FF FF FF FF FF FF FF FF FF 00 is the sync pattern of a raw CD sector.
  • Long runs of 00 or FF are empty space or padding.

Spotting these helps you understand any file quickly. Read more in what a BIN file is.

Intel HEX: the other “BIN to HEX”

Electronics engineers mean something different by BIN to HEX. They mean the Intel HEX format. It is a text file used to program microcontrollers and memory chips. Each line starts with a colon and holds a short record with an address, the data bytes and a checksum.

A line looks like this:

:10010000214601360121470136007EFE09D2190140

Breaking it down: 10 is the byte count (16), 0100 is the address, 00 is the record type for data, then 16 data bytes, then a checksum at the end.

Why use it? Intel HEX files can describe data at any address, include gaps and catch transfer errors with the checksums. Many chip programmers and IDEs prefer it.

How to convert BIN to Intel HEX

You need to know the start address where the data should go in the chip. Then use a converter:

  • objcopy, part of the free GNU binutils: objcopy -I binary -O ihex --change-addresses 0x08000000 file.bin file.hex
  • srec_cat, from the free SRecord package: srec_cat file.bin -binary -offset 0x08000000 -o file.hex -intel
  • Many microcontroller IDEs and programmer tools also have a built-in export to HEX.

Replace 0x08000000 with the start address your chip needs. Using the wrong address means the code lands in the wrong place.

How to convert Intel HEX back to BIN

The same tools work in reverse: objcopy -I ihex -O binary file.hex file.bin. Gaps between addresses are filled, usually with 00 or FF.

Hex dump vs Intel HEX vs Base64

  • Hex dump is for people. It shows bytes neatly so you can read and compare them.
  • Intel HEX is for chip programmers. It holds addresses and checksums.
  • Base64 is for systems that only accept text. It is compact but not human-friendly. See BIN to TXT for details.

Comparing two BIN files in hex

Hex is perfect for spotting differences, such as between two firmware versions or a good and bad chip dump.

  1. Open both files in our tool, one after the other, and compare their SHA-256 values first. If they match, the files are identical and you can stop.
  2. If they differ, export a hex dump of each.
  3. Compare the two dumps with a text diff tool. On Windows, fc /b file1.bin file2.bin in Command Prompt lists every byte that differs. On Mac and Linux, cmp -l file1.bin file2.bin does the same.

A quick example

Faisal is fixing a TV. The repair forum asks him to post the first 64 bytes of his EEPROM dump. He opens eeprom.bin in our tool. The hex view shows the first four rows. He copies them into his post. Another member spots a corrupted header at offset 0x20 right away. The fix takes ten minutes instead of a day of guessing.

Tips

  • Always share small parts of a hex dump, not whole private files.
  • Use the offset column when you talk about a location. “Byte 0x1F4” is clear. “Somewhere near the top” is not.
  • Remember that numbers longer than one byte may be stored backward, called little-endian. 34 12 can mean 0x1234.
  • Keep the original BIN. A hex dump is a copy for reading, not a backup.

Why programmers love hex

Hex is not just tradition. It maps perfectly onto how computers store data. One hex digit equals four bits, so two digits equal one byte. Four digits equal two bytes, and eight digits equal four bytes. That makes it easy to read addresses, colors and numbers straight from a dump. For example, the web color #9B5DE0 is just three bytes in hex: 9B for red, 5D for green and E0 for blue. Once you get used to it, hex becomes a quick, clear way to see exactly what is inside any file.

You do not need to convert hex to normal numbers in your head. Any calculator app in programmer mode does it for you. On Windows, open Calculator and switch to Programmer. On Mac, open Calculator and choose View, then Programmer.

Frequently asked questions

Can I convert BIN to HEX online?

Yes. Our online BIN file viewer shows the hex instantly and exports a hex dump. It runs in your browser, so the file is not uploaded.

Is BIN to HEX conversion lossless?

Yes. A hex dump or Intel HEX file holds every byte. You can convert it back to the exact original.

Why is the hex file bigger than the BIN?

Each byte becomes two characters, plus spaces, offsets and text columns. Expect three to four times the size.

What start address should I use for Intel HEX?

It depends on your chip. Check its datasheet or your IDE settings for the flash start address.

Conclusion

For most people, BIN to HEX means seeing the file as a hex dump. Our free BIN file opener does that in seconds and lets you export it. If you program chips, you probably want Intel HEX, which you can make with objcopy or srec_cat using the right start address. Either way, hex is the clearest window into any binary file. To go deeper, read how to read a binary file.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *