The invention relates to a laboratory method for preparing hydrocarbons by deoxidizing stearic acid, belonging to production and preparation of biofuels. The method comprises the following steps: weighing 5 wt.% of Pd / C catalyst, adding the catalyst into a reaction kettle, charging hydrogen gas of which the volume percent is 25%, gradually heating to 200 DEG C, and keeping the temperature for 30 minutes to carry out catalyst pretreatment; and adding the pretreaed Pd / C catalyst, stearic acid and dodecane into the reaction kettle, charging hydrogen gas and argon gas, heating while stirring, and filtering to separate out the Pd / C catalyst, thereby obtaining the catalytic deoxidization reaction products, such as hydrocarbons and the like, wherein the Pd / C catalyst-stearic acid-dodecane mass ratio is (2-5):90:80. The Pd / C catalyst has the advantages of high catalyst activity and stable performance, and can be recycled; and the prepared petroleum-base hydrocarbon liquid fuel has the advantages of high heat value, high stability and high low-temperature fluidity, and thus, has instruction meaning and development value.