Microalgae are a diverse group of microorganisms, the majority of which are photosynthetic in nature. Microalgae have different applications, the most important of which is the biological treatment of wastewater. Microalgae grow in various types of wastewater, such as wastewater polluted by Azo dyes, due to microalgae using wastewater as a culture medium, which contains many nutrients like nitrogen, phosphate, and carbon sources. Microalgae grow in various types of wastewater, such as wastewater polluted by Azo dyes, due to microalgae using wastewater as a culture medium, which contains many nutrients like nitrogen, phosphate, and carbon sources. So, microalgae are used for bioremediation of wastewater due to the efficiency of growing in wastewater and for the high production of lipids followed by trans-esterification to biodiesel. Face-centered central composite design (FCCCD) was used to determine the factors that have the most significant impact on the simultaneous decolorization of methyl red and lipid production by the fresh green alga Scenedesmus obliquus. The predicted results indicated that the alga decolorized 70.15% methyl red and produced 20.91% lipids by using 1 g/L nitrogen, an incubation time of 10 days, a pH of 8, and the concentration of methyl red is 17.65 mg/L. The dry biomasses of S. obliquus were also examined by SEM and FTIR before and after treatment with methyl red. SEM and FTIR showed that the properties of dry S. obliquus were altered after the biosorption of methyl red. According to GC–MS analysis of hexane extracts of S. obliquus, the lipid profile differed before and after methyl red decolorization. The results proved that it is possible to use S. obliquus to remove dyes and produce renewable fuels such as biodiesel. The novelty of this study is that this is the first time in which the effect of nitrogen concentrations in the medium used for algal growth on the removal of dye has been studied.