Non-steroidal anti-inflammatory drugs (NSAIDs) and low-dose acetylsalicylic acid (ASA) have several adverse gastrointestinal (GI) effects, including upper GI bleeding. We aimed to develop a simple risk score to identify high risk NSAID and ASA users for primary upper GI bleeding. Using data from two large anonymized health insurance databases, we defined a development and validation cohort with NSAID and ASA users which were followed-up for the occurrence of a primary upper GI bleeding. Cox regression analyses identified risk factors which were combined into simple risk scores. C-statistics were used to evaluate the discriminative ability of these scores in a validation cohort. In total, 421 cases of upper GI bleeding were identified in the initial cohort of 784,263 NSAID users (incidence rate 54.2 per 10,000 person-years), while 1,295 cases of upper GI bleeding were identified in 235,531 ASA users (incidence rate 37.9 per 10,000 person-years). The risk of upper GI bleeding increased with a higher risk score, which for NSAID users included age, male gender, anemia and concomitant use of ASA or anticoagulants. For ASA users, age, anemia, diabetes and concomitant use of other antiplatelet drugs or anticoagulants were included in the risk score. The C-statistics in the validation cohort were 0.68 and 0.63 or NSAID and ASA users, respectively. Risk factors for primary upper GI bleeding are to a large extent similar for NSAID and ASA users. Using a risk score based on these risk factors, patients at the highest risk can be identified with moderate accuracy.