The optimal time for a heartbeat scan during pregnancy is typically around 6-8 weeks. At this stage, it is possible to detect the fetal heartbeat using an ultrasound. However, keep in mind that every pregnancy is unique, and factors such as the position of the uterus or the accuracy of menstrual dates can affect when the heartbeat becomes visible. It's best to consult with your healthcare provider to determine the most appropriate timing for your specific situation.