Many people in the United Kingdom are turning to the internet to obtain prescription-only medicines (POMs). This introduces substantial concerns for patient safety, particularly owing to the risk of buying fake medicines. To help reduce the risks to patient safety, it is important to understand why people buy POMs on the web in the first place. This study aimed to identify why people in the United Kingdom purchase medicines, specifically POMs, from the internet, and their perceptions of risks posed by the availability of fake medicines on the web. Semistructured interviews were conducted with adults from the United Kingdom who had previously purchased medicines on the web. Purposive sampling was adopted using various methods to achieve diversity in participants' experiences and demographics. The recruitment was continued until data saturation was reached. Thematic analysis was employed, with the theory of planned behavior acting as a framework to develop the coding of themes. A total of 20 participants were interviewed. Participants had bought various types of POMs or medicines with the potential to be misused or that required a higher level of medical oversight (eg, antibiotics and controlled medicines). Participants demonstrated awareness of the presence and the risks of fake medicines available on the internet. The factors that influence participants' decision to buy medicines on the web were grouped into themes, including the advantages (avoiding long waiting times, bypassing gatekeepers, availability of medicines, lower costs, convenient process, and privacy), disadvantages (medicine safety concerns, medicine quality concerns, higher costs, web-based payment risks, lack of accountability, and engaging in an illegal behavior) of purchasing medicines on the web, social influencing factors (interactions with health care providers, other consumers' reviews and experiences, word of mouth by friends, and influencers' endorsement), barriers (general barriers and website-specific barriers) and facilitators (facilitators offered by the illegal sellers of medicines, facilitators offered by internet platforms, COVID-19 outbreak as a facilitating condition, and participants' personality) of the purchase, and factors that lead people to trust the web-based sellers of medicines (website features, product appearance, and past experience). In-depth insights into what drives people in the United Kingdom to buy medicines on the web could enable the development of effective and evidence-based public awareness campaigns that warn consumers about the risks of buying fake medicines from the internet. The findings enable researchers to design interventions to minimize the purchasing of POMs on the web. A limitation of this study is that although the interviews were in-depth and data saturation was reached, the findings may not be generalizable, as this was a qualitative study. However, the theory of planned behavior, which informed the analysis, has well-established guidelines for developing a questionnaire for a future quantitative study.