Online purchasing has revolutionized consumer market. It allows individuals to access a variety of products with a single click. With evolution of e-commerce understanding the factors influencing online shopping behavior is imperative for firms to remain competitive. This study investigates the relationship between perceived benefits (PB) and perceived risks (PR), mediated by purchase intention (PI) on online buying behavior (OSB). Six key elements—shopping convenience, product variety, price advantage, product risk, privacy risk, and financial risk—were evaluated through data collected from 300 internet shoppers via a structured questionnaire. The data is analyzed with SPSS. Results underline the significance of convenience, product variety, and price advantage in stimulating online purchases, with PB positively impacting customers' online purchasing behavior (OPB). Conversely, perceived risks negatively affect online shopping decisions, necessitating efficient risk management strategies to bolster consumer confidence. The mediation role of PI was examined using the Hayes macro process, revealing its significance in the relationship between PB, PR, and OSB. Notably, PI mediates the impact of both PB and PR on OSB, highlighting its pivotal role in shaping consumers' online purchasing behavior. These findings offer actionable insights for businesses, emphasizing the importance of leveraging PB to encourage beneficial purchasing intentions and mitigate PR to foster online shopping behavior. Ultimately, this study contributes to a deeper understanding of consumer decision-making in online settings, facilitating the development of targeted marketing strategies and enhancing overall online shopping experiences.