In Taiwan's public health system, community-based pharmacists are key first-line health care providers due to their high accessibility. During the COVID-19 pandemic, the pharmacists played a central role in the distribution of these supplies through the Name-Based Rationing System (NBRS), during an acute shortage of masks and testing kits, that helped reduce the spread of the disease. The NBRS, an innovative government-guided strategy developed after the COVID-19 outbreak, provided equitable and convenient access to masks and COVID-19 test kits. This study aimed to investigate (1) Taiwanese pharmacists' knowledge, attitude, and practices (KAPs) of COVID-19, with the intention to assess their preparedness for public health emergencies and their capabilities to implement COVID-19-related policies effectively; (2) their perspectives toward the NBRS; and (3) the association between individual's KAP and corresponding perspectives toward the NBRS. A cross-sectional, web-based survey was conducted in 2 major cities in Taiwan, from June 18 to September 11, 2022, during the peak of the COVID-19 pandemic. To gauge community pharmacists' KAP, a 66-question instrument was developed using guidelines from the Taiwanese Centers for Disease Control, the International Pharmaceutical Federation, and the Taiwanese Pharmacist Association. The instrument's internal consistency reliability was ascertained using Cronbach α (0.819), and its content validity was verified by field experts. Overall, 343 Taiwanese community pharmacists were recruited in the study. Among them, 88% (303/343) scored high on knowledge domain questions related to SARS-CoV-2; 58% (201/343) and 39% (136/343) held positive and neutral attitudes toward COVID-19-related policies, respectively; and 77% (266/343) practiced infectious disease prevention measures in compliance with official guidelines. The results demonstrated a high level of competency in pharmacists in a public health crisis. It revealed that factors including age, pharmacy characteristics, and the number of customers were associated with their perceptions and willingness to continuously participate in the NBRS. Overall, the community pharmacists showed greater support for the COVID-19-testing NBRS compared with the mask NBRS, because of the more favorable influence on the revenue and workforce of the pharmacies and the well-being of the pharmacists. Responses also highlighted concerns about rapid government policy changes and supply dynamics, underscoring the importance of effective communication and considering supply availability in facilitating a successful NBRS. The strong KAP of the community pharmacists justified the government leveraging their expertise in Taiwan's COVID-19 response. While community pharmacies have proven to be essential distribution centers through the NBRS, improving community connections, communication with the government, and supply management are recommended to strengthen the system. These potential approaches aim to ensure successful NBRS implementation and better preparedness for future public health emergencies. Overall, pharmacists have demonstrated their integral role in achieving equitable outcomes and their dedication to public health efforts during crises.