We analyze data from nearly 2 million text messages (tweets) across over 16,000 users on Twitter to examine differences between Christians and atheists in natural language. Analyses reveal that Christians use more positive emotion words and less negative emotion words than atheists. Moreover, two independent paths predict differences in expressions of happiness: frequency of words related to an intuitive (vs. analytic) thinking style and frequency of words related to social relationships. These findings provide the first evidence that the relationship between religion and happiness is partially mediated by thinking style. This research also provides support for previous laboratory studies and self-report data, suggesting that social connection partially mediates the relationship between religiosity and happiness. Implications for theory and the future of social science using computational methods to analyze social media are discussed.