A device is for aligning an aiming hole of an aiming device with a locking hole of an intramedullary nail. The device includes a sensing unit sized and shaped for insertion through an aiming hole of an aiming device attachable to an intramedullary nail. The sensing unit detects a magnetic field produced by a magnet and outputs an alignment signal based on a magnetic field parameter at first and second locations relative to the magnet.