The invention relates to an offshore natural gas liquefying method and an offshore natural gas liquefying device. The method comprises the following steps of: 1) pretreating natural gas extracted from seabed, and inputting into a heat exchange cold box; 2) continuously reducing pressure and temperature of preset carbon dioxide gas in a carbon dioxide pre-cooling circulating system, and introducing the carbon dioxide gas into the heat exchange cold box; 3) compressing preset nitrogen in a double nitrogen expansion refrigeration circulating system into high pressure nitrogen, introducing the high pressure nitrogen into the heat exchange cold box, precooling by carbon dioxide, directly reducing pressure and temperature of one path of nitrogen by using an expander, continuously precooling the other path of nitrogen and reducing pressure and temperature by using the expander, returning the two path of low pressure nitrogen to the heat exchange cold box, exchanging heat, raising the temperature, lifting the pressure, reducing the temperature, and returning to the heat exchange cold box; and 4) precooling the pretreated natural gas by using the carbon dioxide gas in the heat exchange cold box, introducing into a heavy hydrocarbon separation unit, gradually cooling the natural gas by the returned nitrogen, removing the heavy hydrocarbon by using a gas-liquid separator and a rectifying column, cooling, throttling and reducing temperature by using a throttle valve, introducing a gas-liquid mixture into a buffer tank, introducing a liquid phase into a storage tank for storage, discharging a gas phase from the top of the buffer tank and collecting the gas phase.