Like other ectotherms, the roundworm Caenorhabditis elegans and the fruit fly Drosophila melanogaster rely on behavioral strategies to stabilize their body temperature. Both animals use specialized sensory neurons to detect small changes in temperature, and the activity of these thermosensors governs the neural circuits that control migration and accumulation at preferred temperatures. Despite these similarities, the underlying molecular, neuronal, and computational mechanisms responsible for thermotaxis are distinct in these organisms. Here, we discuss the role of thermosensation in the development and survival of C. elegans and Drosophila, and review the behavioral strategies, neuronal circuits, and molecular networks responsible for thermotaxis behavior.