When confronted, this species will quickly attempt to escape and avoid any sort of confrontation. However, if continuously provoked, the king cobra can be highly aggressive.
When concerned, 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, and 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 dramatise 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 hoodand 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.
The king cobra, in defense of itself is able to kill an elephant with a single bite. Except for one documented black mamba snake bite killing an elephant, all other documented cases in the scientific literature have been of elephants being killed due to king cobra bites.
A good defence against a cobra for anyone who accidentally encounters this snake is to slowly remove a shirt or hat and toss it to the ground while backing away.