Tramadol is a prescription medication used to treat moderate to moderately severe pain. It is an opioid medication, so it works by changing how your body feels and responds to pain. When taken as directed, Tramadol can provide relief from pain for up to six hours.