The invention relates to a three-dimensional emergency escape guiding method based on a wireless sensor network, which comprises the following steps: 1) node initiation, namely setting a weight <1, w> of each node, wherein 1 refers to the danger level of a floor where the node is positioned, and w refers to the danger level of the node in the floor, and setting the following parameters: a constant D, Ai, Ai and e[i, j]; and 2) guiding process, wherein when a sensor node x senses fire, the sensor node x sets the self weight as Adis and simultaneously broadcasts an emergency message to the network, and other nodes decide self guiding directions through calculation after receiving the emergency message; and when a sensor node y receives an emergency message sent by a neighbor node z, the sensor node y updates a weight of z in a neighbor list by Az, and directs to a neighbor with the minimum weight. The method can obtain the optimal escape path, and has good reliability.