Code is a settlement in Bauska Municipality, in the Zemgale Planning statistical region, Latvia. Code lies at 26 m above sea level, by the Īkstrums. It has 563 inhabitants (2025). The nearest city is Jelgava, 34 km to the west. Near the border: Lithuania, 18 km. Among the landmarks around are Rundāle Palace (10.9 km), Bauska Castle (7.1 km) and Bauska Church of the Holy Spirit (6.4 km).