Surgery is used to diagnose cancer, determine its stage, and to treat cancer.

One common type of surgery that may be used to help with diagnosing cancer is a biopsy.
A biopsy involves taking a tissue sample from the suspected cancer for examination by a specialist in a laboratory. A biopsy is often performed in the physician's office or in an outpatient surgery center. A pathologist will review the sample and determine if cancer is present. A positive biopsy indicates the presence of cancer; a negative biopsy may indicate that no cancer is present in the sample.

When surgery is used for treatment, the cancer and some tissue adjacent to the cancer are typically removed. Sometimes lymph nodes that are located close to the site of the cancer can be removed to see if they test positive for cancerous cells. If they do, the doctor can typically determine which lymph node was affected first and how many were infected. This helps the oncologist create the most accurate treatment plan.

In addition to providing local treatment of the cancer, information gained during surgery is useful in predicting the likelihood of cancer recurrence and whether other treatment modalities will be necessary.