Tramadol is a potent pain reliever that belongs to the class of drugs known as opiates, or narcotics. It is used to treat pain that ranges from moderate to severe, such as after surgery or a serious injury. If weaker painkillers no longer help, your doctor may also prescribe it if you have chronic pain.