The safety of vehicles and citizens on urban road networks is a major subject, especially if these vehicles carry hazardous materials (hazmats). The paper focuses on developing an optimised index to identify the safest routes between any origin–destination pair within urban networks. The considered parameters include population, traffic safety, volume–capacity ratio, emergency response time, type of hazmat and sensitive and vulnerable places. Notably, this study is the first to incorporate the last two parameters and the combination of all parameters in route optimisation. The research formulates a hazardous material vehicle routing problem and proposes an algorithm to solve it. The approach is applied to a case study in Mashhad city, presenting the safest routes for transporting three types of hazmats. The findings indicate that the reduction in average risk score is comparable with the increase in average travel time; however, gain of the safest routes is lower than loss of the longer distance. The proposed method is practical and applicable to diverse urban networks, aiding in the routing and planning of any hazmat-type transportation.