The invention relates to a cleaning agent for organic sediments inside an oil tank and a preparation method of the cleaning agent. The cleaning agent comprises the following components in percentage by mass: 30%-60% of tetramethoxy-propane, 20%-40% of dimethoxy-ethane, 5%-15% of diethylene glycol octyl ether, 2%-10% of sodium polyphosphate, 1%-1.5% of sodium alkyl benzene sulfonate and 2%-3.5% of lauryl sodium sulfate. The cleaning agent disclosed by the invention can be cleaned on line and also be cleaned off line, generates no influence on production because of no need of shutdown when used for cleaning on line, so that cost and time are saved; the cleaning agent is harmless to an operator because an operator unnecessarily enters the oil tank, is pollution-free on the environment, can be used for recovering 90% hydrocarbon by recycling sludge and has the advantages of outstanding economic benefit, simple preparation method, short cleaning operation time, high cleaning quality, ecological and environmental friendliness, no three wastes discharge, no need of anti-rust treatment on a container after cleaning, good social benefit and economic benefit, harmlessness on human bodies, no corrosion on equipment and no secondary pollution.