With the increasing stringency on sulfur content in petrodiesel, there is a growing tendency of broader usage of ultra low sulfur diesel (ULSD) with sulfur limit of 15 ppm. Refineries should develop cost- effective and sustainable strategies to meet the requirement. In addition to the conventional approach of revamping existing hydrotreating facilities, blending petrodiesel with biodiesel is a potentially attractive option. In this work, petrodiesel and biodiesel production processes were simulated. Next, process integration techniques were employed to optimize the processes, including both mass and heat integration. Cost estimation was carried out and optimization was performed for three blending options. In addition to the economic comparison, life-cycle greenhouse gas emission and safety issues were also investigated. This work should help shed some light on development of alternative sustainable resources and especially on the option of blending biodiesel. It should be useful to professionals in energy industry, and anyone else who are interested in process economics, environmental and safety aspects of petrodiesel and biodiesel production.