Microalgae are recognized as a promising source for biofuel production, which is known as a renewable source of energy. This study was conducted to optimize the biodiesel production quantitatively and qualitatively by the microalga, Nannochloropsis oculata upon culturing on two different culture media (F/2 and Boussiba media) as a comparative study through stress in the main culture compositions by 1) Treating with different salinity concentrations (20, 40 and 60psu), 2) Depleting from phosphorus (P) and nitrogen (N) sources for the two media. After different treatments, the growth rate, protein, carbohydrate, lipid, and fatty acids contents were determined. The algal analysis cleared that increasing salinity to 60psu in F/2 medium and 40psu on the Boussiba medium led to increasing the number of N. oculata cells with the maximum protein and carbohydrate contents at late exponential phase. At lower salinity, there were no significant differences in total protein content while carbohydrate contents showed slight variations, and its minimum values were obtained at (N) starved medium. Total lipid and total fatty acids content were higher in N. oculata cultured on F/2 medium than on Boussiba medium at different treatments and achieved its maximum when cultured on N-starved > P-depleted > Salt-stressed 60psu, respectively. The highest physical properties of the produced biodiesel represented in the degree of unsaturation (SD), iodine values (IV), Cetane number (CN), and oxidation stability were recorded in N. oculata cultured on higher salinities and N-depleted conditions in the two media. Using higher salinities up to 40psu (available in the natural seawater), N-depletion or P-depletion in F/2 medium for achieving highly economical results in the production of N. oculata microalga. Biodiesel produced from N. oculata oil can be considered as a potential candidate for commercial sources.