The use of microalgae as a feedstock in biofuel production is highly encouraging. The marine diatom in this study, Thalassiosira pseudonana, was used as a test organism to evaluate the impact of nitrogen or phosphorus limitation and sewage water on improving biodiesel production. The growth rate is more affected in cultures without phosphorus by 41.8% lower than in control and the highest dry weight estimated in control. The cellular dry weight significantly increased in cultures treated with mix1 and mix2 wastewater compared to the control cultures. Chlorophyll a content decreased in the absence of nitrogen and phosphorous and in sewage water cultures. Lipid content in algal cultures without nitrogen or phosphorus and in sewage water accumulated nearly twice as much lipid content in synthetic medium. T. pseudonana showed high FAME contents; the two most abundant fatty acids, stearic acid (C18:0) and palmitoleic acid (C16:1), in the algal extracts revealed that T. pseudonana was predominantly composed of these fatty acids. T. pseudonana grown in nitrogen or phosphorus-deficient conditions exhibited an extreme percentage of saturated fatty acids (SFAs) by 87.38% and 85.47%, respectively, of the total fatty acids (TFAs). More importantly, the low polyunsaturated fatty acid content in oils indicates a high cetane number, low iodine value, and low corrosion for biodiesel quality indicators. Producing biodiesel that closely meets worldwide biodiesel requirements (ASTM D6751 and EN 14214) is the goal of this work, which shows that growing T. pseudonana under nutrient limitations leads to algal metabolism in that direction.