Seppuku is also known as hara-kiri ("belly-cutting") and is written with the same kanji as seppuku but in reverse order with an okurigana. In Japanese, hara-kiri is a colloquialism, seppuku being the more formal term. Samurai (and modern adherents of bushido) would use seppuku, whereas ordinary Japanese (who in feudal times as well as today looked askance at the practice) would use hara-kiri. Hara-kiri is the more common term in English, where it is often mistakenly rendered "hari-kari."

Seppuku was a key part of bushido, the code of the samurai warriors; it was used by warriors to avoid falling into enemy hands, and to attenuate shame. Samurai could also be ordered by their daimyo (feudal lords) to commit seppuku. Later, disgraced warriors were sometimes allowed to commit seppuku rather than be executed in the normal manner. Since the main point of the act was to restore or protect one's honor as a warrior, those who did not belong to the samurai caste were never ordered or expected to commit seppuku. Samurai women could only commit the act with permission.

In his book The Samurai Way of Death, Samurai: The World of the Warrior (ch.4), Dr. Stephen Turnbull states:

Seppuku was commonly performed using a tantō. It could take place with preparation and ritual in the privacy of one's home, or speedily in a quiet corner of a battlefield while one’s comrades kept the enemy at bay.

In the world of the warrior, seppuku was a deed of bravery that was admirable in a samurai who knew he was defeated, disgraced, or mortally wounded. It meant that he could end his days with his transgressions wiped away and with his reputation not merely intact but actually enhanced. The cutting of the abdomen released the samurai’s spirit in the most dramatic fashion, but it was an extremely painful and unpleasant way to die, and sometimes the samurai who was performing the act asked a loyal comrade to cut off his head at the moment of agony.

Ritual

In time, committing seppuku came to involve a detailed ritual. A Samurai was bathed, dressed in white robes, fed his favorite meal, and when he was finished, his instrument was placed on his plate. Dressed ceremonially, with his sword placed in front of him and sometimes seated on special cloths, the warrior would prepare for death by writing a death poem. With his selected attendant (kaishakunin, his second) standing by, he would open his kimono (clothing), take up his wakizashi (short sword) or a tantō (knife) and plunge it into his abdomen, making a left-to-right cut. The kaishakunin would then perform daki-kubi, a cut in which the warrior was all but decapitated (a slight band of flesh is left attaching the head to the body). Because of the precision necessary for such a maneuver, the second was often a skilled swordsman. The principal agreed in advance when the kaishaku made his cut, usually as soon as the dagger was plunged into the abdomen.

Source : http://en.wikipedia.org