The invention relates to a liquid oxygen and liquid nitrogen preparation device and method. The device comprises a self-cleaning air filter, an air compressor, a cold air unit, a separator, a molecular sieve adsorber, a main heat exchanger, a lower tower, an upper tower, a subcooler and an expander. The raw material of the device is air. The air passes through the self-cleaning air filter, the air compressor, the supercharging end of the expander, the cold air unit and the molecular sieve adsorber in sequence and then enters a cold box; after passing through the main heat exchanger, a part of the air is pumped out of the lower middle portion of the main heat exchanger and enters the expanding end of the turbo expander for adiabatic expansion; expanded air is reheated by the main heat exchanger and then sent out of the cold box; the remaining air is cooled to a liquefaction point, goes out of the main heat exchanger and enters the lower tower for rectification. A liquid oxygen product is pumped out of the bottom of the lower tower and then conveyed to a liquid oxygen storage tank; a liquid nitrogen product is pumped out of the main cold liquid nitrogen side and then conveyed to a liquid nitrogen storage tank. According to the liquid oxygen and liquid nitrogen preparation device and method, operation is simple in the technological process, the extraction rate is high, energy consumption is low, and meanwhile equipment investment cost is low.