I have bad pain in upper back it hurts to breathe. What could be wrong?

Several Possibilities. This likely is a simple back strain as upper back muscles do expand during breathing and if strained, will cause pain. However, if you have chest pain, shortness of breath and new swelling to one of your legs, take birth control/smoke, have a history of cancer, a recent surgery -- pulmonary embolism while unlikely, is a possibility. Contact me if you would like to discuss further.