Student attendance is one of the essential aspects of school administration to monitor students' presence and discipline. The manual attendance system still used at SMP Negeri 6 Medan is considered ineffective as it requires time, effort, and is prone to recording errors. This study aims to develop a web-based online attendance application that utilizes the Ray Casting algorithm to verify students' locations when marking their attendance. The Ray Casting algorithm is used to determine whether the GPS coordinates of the student’s location are within a polygon area representing the school’s location. The system is built using PHP, HTML, CSS programming languages, and a MySQL database, along with GPS-enabled devices. The system development method uses an Agile approach, which includes planning, design, coding, testing, and implementation stages. Testing was conducted on a number of students from SMP Negeri 6 Medan, with main features including user login, GPS location retrieval, selfie photo, and attendance history recording. The test results show that the system can verify attendance automatically and accurately. This application is expected to improve efficiency, reduce fraud, and serve as a reference for developing location-based attendance systems at SMP Negeri 6 Medan.