To clarify whether changes in frequency of going out due to the COVID-19 pandemic affect ikigai (sense of purpose in life) and mental health in Japanese middle-aged and older adults. In a questionnaire survey mailed to 16,866 adults aged > 40 years in Japan in September 2020, 7,973 responses were received (response rate, 47.3%) in October 2020. Following exclusions, data from 6,978 individuals (50.6% female, mean age 67.8 ± 12.2 years) were available for analysis. Respondents were categorized based on changes in frequency of going out, reflecting changes in social and/or physical activity, during the pandemic compared with before it: the previously active group went out often before but less often during the pandemic; the remained active group continued going out often; and the inactive group continued not going out often. Whether these changes affected the respondents’ ikigai and mental health was investigated. The previously active group had a significantly higher proportion of individuals with decreased ikigai during the pandemic than the other groups. Mental health score decreased in all groups during the pandemic, but more so in the previously active group (-3.21), followed by the inactive and then the remained active groups (-1.45 and -1.28, respectively). Previously active individuals showed the greatest decline in ikigai and mental health among the three groups. These findings suggest that continuing to engage in appropriate physical and social activities, including going out, while following appropriate infection control measures, even under restrictions, can help people maintain ikigai and mental health.