If you have the .ino sketch and want to generate the machine-readable .hex file without uploading it, you can use the built-in features of the Arduino IDE.
Extracting a .hex file from an Arduino is a common necessity for cloning projects, creating backups, or simulating circuits in software like Proteus . Depending on whether you have the original source code or only the physical board, there are two primary ways to "download" or generate this file. 1. Generating a HEX File from Source Code download hex file from arduino