Background: While rates of HIV and sexually transmitted infections (STIs) are extremely high among adolescents and young adults in the United States, rates of HIV and STI testing remain low. Given the ubiquity of mobile phones and the saliency of peers for youths, text messaging strategies may successfully promote HIV or STI testing among youths. Objective: This study aimed to understand the types of messages youths believe were motivating and persuasive when asked to text friends to encourage them to seek HIV or STI testing services at a neighborhood clinic. Methods: We implemented an adolescent peer-based text messaging intervention to encourage clinic attendance and increase STI and HIV testing among youths (n=100) at an adolescent clinic in San Francisco, California. Participants were asked to send a text message to 5 friends they believed were sexually active to encourage their friends to visit the clinic and receive STI or HIV screening. Thematic analysis was used to analyze the content of the text messages sent and received during the clinic visit. Member checking and consensus coding were used to ensure interrater reliability and significance of themes. Results: We identified four themes in the messages sent by participants: (1) calls to action to encourage peers to get tested, (2) personalized messages with sender-specific information, (3) clinic information such as location and hours, and (4) self-disclosure of personal clinic experience. We found that nearly all text messages included some combination of 2 or more of these broad themes. We also found that youths were inclined to send messages they created themselves, as opposed to sending the same message to each peer, which they tailored to each individual to whom they were sent. Many (40/100, 40%) received an immediate response to their message, and most participants reported receiving at least 1 positive response, while a few reported that they had received at least 1 negative response. There were some differences in responses depending on the type of message sent. Conclusions: Given the high rates of STI and HIV and low rates of testing among adolescents, peer-driven text messaging interventions to encourage accessing care may be successful at reaching this population. This study suggests that youths are willing to text message their friends, and there are clear types of messages they develop and use. Future research should use these methods with a large, more diverse sample of youths and young adults for long-term evaluation of care seeking and care retention outcomes to make progress in reducing HIV and STI among adolescents and young adults.