The rapid progress of digital devices and technology, coupled with the emergence of the internet has amplified the risks and perils associated with malicious attacks. Consequently, it becomes crucial to protect valuable information transmitted through the internet. Steganography is a tried-and-true technique for hiding information beneath digital content, such as pictures, texts, audio, and video. Various methodologies of image steganography have been developed recently. In image recognition, edge detection secures an image into well-defined areas. This paper introduces a novel image steganography algorithm with edge detection and XOR coding techniques. The proposed approach aims to conceal a confidential message within the spatial domain of the original image. In contrast to uniform regions, the Human Visual System (HVS) is less responsive to variations in the sharp areas; an edge detection algorithm is applied to identify edge pixels. Furthermore, to enhance the efficiency and reduce the embedding impact, XOR operation has been utilized to embed the secret message in the Least Significant Bit (LSB). According to the results of the experiments, the proposed method embeds confidential data without causing noticeable modifications to the stego image. The proposed method system produced imperceptible stego images with minimal embedding distortions compared to existing methods. Based on the results, the proposed approach outperforms the conventional methods regarding image distortion techniques. The PSNR values achieved by the proposed method are higher than the acceptable level.