The invention discloses a technology for preparing liquefied natural gas and liquid ammonia by using coke oven gas. The coke oven gas is subjected to the steps of compression, purification, methanation, cryogenic separation and liquefaction of synthetic natural gas, variable pressure adsorptive separation and liquid ammonia preparation with hydrogen rich gas, so that the liquefied natural gas (LNG) of which methane purity is more than 99 percent and the liquid ammonia reaching national first level standard are obtained. By the technology, the hydrogen byproduct of the coke oven gas for preparing the LNG is fully utilized; effective ingredients of the coke oven gas such as H2, N2, CH4, CO and CO2 are furthest utilized; the CO and the CO2 are methanated, so that the yield of the CH4 is improved by about 1/3; the liquefied CH4 is used as the LNG and sold; and the rest nitrogen-containing hydrogen-rich gas is used as a raw material for synthesizing ammonia, so that the additional value of the coke oven gas is improved, and reliable raw material guarantee is provided for developing downstream products with high additional values and prolonging the product chain.