Abstract A biotemplate of grapefruit exocarp was used to synthesis porous hierarchical SnO 2 and its gas sensing properties were investigated in this manuscript. Biomorphic SnO 2 with lamellar and plicated membranes and porous walls were synthesized by using grapefruit exocarp template combining with ultrasonic shaking and following calcination. The porous hierarchical structure of biomorphic SnO 2 was characterized by field emission scanning electron microscope, transmission electron microscopy, nitrogen adsorption–desorption isotherm, etc. The biomorphic SnO 2 exhibits small grain size around 10 nm, a relatively large BET surface area and mesoporosity. Growth mechanism of biomorphic SnO 2 was proposed. The sensing properties of the biomorphic SnO 2 to formaldehyde vapor were measured. The optimal operating temperature of the sensor was 200 °C and the response value of the sensor to 10 ppm formaldehyde was 50. The sensor showed a good selectivity to formaldehyde in methanol, acetone, toluene, benzene and ammonia. The stability and the effect of humidity of the sensor were also tested. The gas sensing mechanism of the biomorphic SnO 2 to formaldehyde was analyzed briefly.