The invention discloses a preparation method of a titanium dioxide nanotube for a solar cell, belonging to the technical field of new energy source materials. The preparation method comprises the following steps: mixing rice husk with water, standing for staling so as to obtain staled rice husk, sterilizing, washing and drying the staled rice husk, and sequentially carrying out alkaline washing and acid pickling, so as to obtain preprocessed rice husk; mixing the preprocessed rice husk with water, freezing, grinding, carrying out vacuum drying so as to obtain nano-rice husk fibers, dispersingthe nano-rice husk fibers into a tetrabutyl titanate diluent, slowly dropwise adding an acetic acid solution, after the dropwise adding of the acetic acid solution is finished, proceeding reaction, filtering, washing, and drying, so as to obtain supported nano-fibers; and slowly heating the supported nano-fibers under the protection of inert gas, carrying out thermal insulation reaction, and carrying out annealing, so as to obtain the titanium dioxide nanotube for the solar cell. The titanium dioxide nanotube has the characteristics of high specific surface area and excellent dye adsorption performance and photocatalytic effect.