Gmina Szaflary is a rural gmina (administrative district) in Nowy Targ County, Lesser Poland Voivodeship, in southern Poland. Its seat is the village of Szaflary, which lies approximately 4 kilometres (2 mi) south of Nowy Targ and 71 km (44 mi) south of the regional capital Kraków.
The gmina covers an area of 54.31 square kilometres (21.0 sq mi), and as of 2006 its total population is 10,227.
The gmina contains the villages of Bańska Niżna, Bańska Wyżna, Bór, Maruszyna, Skrzypne, Szaflary and Zaskale.
Gmina Szaflary is bordered by the town of Nowy Targ and by the gminas of Biały Dunajec, Bukowina Tatrzańska, Czarny Dunajec and Nowy Targ.