Look around first
What to notice
- Main prayer hall
- Walls facing west
- Rows of worshippers turned northwest
The story of the place
The main prayer hall is arranged so that its walls face due west, although Mecca lies noticeably farther north from here. Inside, this difference is visible in the safs: the rows of worshippers run across the room and are turned northwest. In a single hall, the old direction of the walls and the different arrangement by which people now stand to pray have both been preserved.
The mosque was built in seventeen seventy-three by order of Sultan Hamengkubuwono I. It is the principal congregational mosque of the Yogyakarta Sultanate: communal Friday prayer was held here, court religious ceremonies took place here, and cases involving marriage, inheritance, and other matters of Islamic law were heard on the veranda. Mosque officials lived nearby with their families. They were called kaum—people responsible for religion and the mosque—and this is where the name Kauman comes from.
In the late nineteenth century, one of these officials was Ahmad Dahlan, a Friday preacher who sought to have the direction of prayer determined by precise calculation. For his service at the mosque, he received seven guilders a month from the sultan's treasury and also traded in batik. The position gave him a place among the court theologians, while his dispute with them put both that position and his salary at risk.
The mosque was oriented due west. In Java, people had long believed that this was enough for prayer in the direction of Mecca. Dahlan studied astronomical calculation and checked the direction using a map and a compass. It turned out that from Yogyakarta, the Kaaba lies approximately twenty-four degrees north of due west. There was no need to rebuild the walls: it was enough to turn the rows of worshippers inside the hall.
In eighteen ninety-eight, Dahlan invited seventeen theologians to a family prayer room nearby. He showed them a map and a compass; his opponents referred to old books and the order established by earlier generations. The discussion continued until dawn and ended without an agreement.
Teenagers from Kauman listened to the dispute behind the prayer room's wall. They accepted Dahlan's calculation and, a few days later, brought it directly into the Kauman Great Mosque: they drew diagonal lines in chalk on the floor, pointing northwest. This was how they intended to turn the rows during the next prayer.
The mosque was managed by the chief court theologian, Kyai Haji Khalil Kamaludiningrat. He ordered the lines erased immediately and the culprits found. Because the angle matched Dahlan's calculation, suspicion fell on the preacher. Dahlan went to Khalil himself and explained that he had sent no one. The investigation found the teenagers: they confirmed that they had acted of their own accord.
The chalk lines disappeared, but Dahlan continued to explain his calculation to the congregation. For disobeying the chief theologian, he was stripped of his position as preacher at this mosque. His opponents then destroyed his small prayer room, which was already oriented northwest. Dahlan planned to leave Kauman; his relatives persuaded him to stay. He kept his batik trade, continued teaching his students, and later founded the religious and educational association Muhammadiyah here.
Nothing remains of the teenagers' white lines. The walls of the main prayer hall still face due west, but the rows of worshippers—the safs—run across the room, turned approximately twenty-four degrees north. People stand in precisely the direction that Khalil Kamaludiningrat once ordered erased from the floor.
Useful on site
An active mosque with no published visitor schedule; the courtyard and exterior are accessible outside worship services, while entry inside is only with permission on site.
Checked: June 24, 2026. Check the official source before visiting.Remember that this is an active mosque: remove your shoes, speak quietly, and do not disturb worship. Visitor access to certain areas may be restricted, and the community's instructions take priority over the route.
