An end ileostomy normally involves removing the whole of the colon (large intestine) through a cut in your abdomen.
The end of the small intestine (ileum) is brought out of the abdomen through a smaller cut and stitched on to the skin to form a stoma.
Over time, the stitches dissolve and the stoma heals on to the skin.
After the operation, waste material comes out of the opening in the abdomen into a bag that goes over the stoma.
This type of ileostomy is often, but not always, permanent.
To form a loop ileostomy, a loop of small intestine is pulled out through a cut in your abdomen.
This section of intestine is then opened up and stitched to the skin to form a stoma. The colon and rectum are left in place.
In these cases, the stoma will have 2 openings, although they'll be close together and you may not be able to see both.
One of the openings is connected to the functioning part of your bowel. This is where waste products leave your body after the operation.
The other opening is connected to the "inactive" part of your bowel that leads down to your rectum.
The loop ileostomy is usually temporary and may be reversed during a second operation at a later date.
In some cases, it may be possible to have a permanent internal ileo-anal pouch, also known as a J pouch, formed instead of an ileostomy.
An ileo-anal pouch is created from the ileum and joined to the anus, so waste material passes out of your body in the normal way.
The pouch stores the waste material until you have a poo.
The area around the pouch usually needs to heal before it's used, so a temporary loop ileostomy may be created above the pouch.
A second, smaller, operation is usually carried out a few months later to close the loop ileostomy.