The King Cobra's generic name, Ophiophagus is a -derived word that means "snake-eater". Its diet consists primarily of other snakes, including rat snakes, pythons, and even other venomous snakes such as various members of the true cobras and the krait. Its most common prey is the rat snake, and it also hunts Malabar Pit Vipers and Hump-Nosed Pit Vipers by following the snakes' odor trails.When food is scarce, it also feeds on other small vertebrates, such as lizards, birds, and rodents. In some cases, the cobra constricts its prey, such as birds and larger rodents, using its muscular body, though this is uncommon. After a large meal, the snake lives for many months without another one because of its slow metabolic rate.
A King Cobra, like other snakes, receives chemical information via its forked tongue, which picks up scent particles and transfers them to a special sensory receptor (Jacobson's organ) located in the roof of its mouth. This is akin to the human sense of smell. When the scent of a meal is detected, the snake flicks its tongue to gauge the prey's location (the twin forks of the tongue acting in stereo); it also uses its keen eyesight; king cobras are able to detect moving prey almost 100 m (330 ft) away. Its intelligence and sensitivity to earth-borne vibration are also used to track its prey.
Following envenomation, the King Cobra swallows its struggling prey. King Cobras, like all snakes, have flexible jaws. The jaw bones are connected by pliable ligaments, enabling the lower jaw bones to move independently. This allows the King Cobra to swallow its prey whole, and swallow prey much larger than its head.
King Cobras are able to hunt throughout the day, but are rarely seen at night, leading most herpetologists to classify them as a diurnal species.
When confronted, this species quickly attempts to escape and avoid confrontation. However, if continuously provoked, the King Cobra can be highly aggressive.
When alarmed, it rears up the anterior portion (usually one-third) of its body when extending the neck, showing the fangs and hissing loudly. It can be easily irritated by closely approaching objects or sudden movements. When raising its body, the King Cobra can still move forward to strike with a long distance and people may misjudge the safe zone. This snake may deliver multiple bites in a single attack, but adults are known to bite and hold on. It is secretive and tends to inhabit less-populated forested regions and dense jungle, thus many victims bitten by King Cobras are actually snake charmers.
Some scientists believe that the temperament of this species has been grossly exaggerated. In most of the local encounters with live, wild King Cobras, the snakes appear to be of rather placid disposition, and they usually end up being killed or subdued with hardly any hysterics. These support the view that wild King Cobras generally have a mild temperament, and despite their frequent occurrence in disturbed and built-up areas, are adept at avoiding humans. Naturalist Michael Wilmer Forbes Tweedie felt that "this notion is based on the general tendency to dramatize all attributes of snakes with little regard for the truth about them. A moment’s reflection shows that this must be so, for the species is not uncommon, even in populated areas, and consciously or unconsciously, people must encounter King Cobras quite frequently. If the snake were really habitually aggressive, records of its bite would be frequent; as it is they are extremely rare."
If a King Cobra encounters a natural predator, such as the mongoose, which has resistance to the neurotoxins, the snake generally tries to flee. If unable to do so, it forms the distinctive cobra hood and emits a hiss, sometimes with feigned closed-mouth strikes. These efforts usually prove to be very effective, especially since it is much more dangerous than other mongoose prey, as well as being much too large for the small mammal to kill with ease.
A good defence for anyone who accidentally encounters this snake is to slowly remove a shirt or hat and toss it to the ground while backing away.