It’s easy to take for granted all the ways your leg muscles stretch, flex, and work together to enable you to go about your daily life.

Whether you walk, stand, sit, or run, it’s due to the work and coordination of your 10 major leg muscles as well as many smaller muscles and tendons.

You may not think about your leg muscles until you experience leg pain, which is often due to muscle strains or cramps. Other conditions, like nerve problems or narrowed arteries, can also cause your legs to hurt, especially when you’re moving around.

Let’s take a closer look at the muscles in your upper and lower leg, as well as the types of conditions that are the most common causes of thigh or calf pain.

There are two main muscle groups in your upper leg. They include:

  • Your quadriceps. This muscle group consists of four muscles in the front of your thigh which are among the strongest and largest muscles in your body. They work to straighten or extend your leg.
  • Your hamstrings. This muscle group is located in the back of your thigh. The key job of these muscles is to bend or flex the knee.

The four muscles that make up your quadriceps include:

  • Vastus lateralis. The largest of the quadriceps muscles, it’s located on the outside of the thigh and runs from the top of your femur (thighbone) down to your kneecap (patella).
  • Vastus medialis. Shaped like a teardrop, this muscle on the inner part of your thigh runs along your thighbone to your knee.
  • Vastus intermedius. Located between the vastus medialis and the vastus lateralis, this is the deepest quadriceps muscle.
  • Rectus femoris. Attached to your hip bone, this muscle helps to extend or raise your knee. It can also flex the thigh and hip.

The three main muscles in your hamstrings run from behind your hip bone, under your gluteus maximus (buttocks), and down to your tibia (shinbone).

The hamstring muscles include:

  • Biceps femoris. Extending from the lower part of your hip bone down to your shinbone, this double-headed muscle helps to flex your knee and extend your hip.
  • Semimembranosus. Running from your pelvis down to your shinbone, this long muscle extends your thigh, flexes your knee, and helps rotate your shinbone.
  • Semitendinosus. Located between the other two hamstring muscles, this muscle helps extend your hip and rotate both the thigh and shinbone.

Your lower leg is the portion between your knee and your ankle. The main muscles of your lower leg are located in your calf, behind the tibia (shinbone).

Your lower leg muscles include:

  • Gastrocnemius. This large muscle runs from your knee to your ankle. It helps extend your foot, ankle, and knee.
  • Soleus. This muscle runs down the back of your calf. It helps to push you off from the ground when you’re walking and also helps stabilize your posture when you’re standing.
  • Plantaris. This small muscle is located behind the knee. It plays a limited role in helping to flex your knee and ankle and is absent in about 10 percent of the population.

The causes of thigh pain can range from minor muscle injuries to vascular or nerve-related issues. Some of the most common causes include:

Muscle strains

Muscle strains are among the most common causes of thigh pain. A muscle strain occurs when the fibers in a muscle are stretched too far or torn.

Causes of thigh muscle strains include:

  • overuse of the muscle
  • muscle fatigue
  • insufficient warmup prior to exercising or doing an activity
  • muscle imbalance — when one set of muscles is much stronger than adjoining muscles, the weaker muscles can become injured

Iliotibial band syndrome

A long piece of connective tissue known as the iliotibial (IT) band runs from the hip to the knee and helps rotate and extend the hip, as well as stabilize your knee.

When it becomes inflamed, it can cause a condition known as IT band syndrome (ITBS). It’s usually the result of overuse and repetitive movements, and is especially common among cyclists and runners.

Symptoms include friction and pain when moving the knee.

Muscle cramps

Muscle cramps, which are involuntary contractions of a muscle or group of muscles, are usually temporary. They’re often brought on by:

Stretching and massaging the affected muscle can help relieve the cramp. Applying a heating pad to the muscle may also help, as well as drinking water or a sports drink with electrolytes.

Non-muscle-related causes

Sometimes, an underlying medical condition can cause thigh pain. Some non-muscle-related causes of thigh pain include:

  • Osteoarthritis. The wear and tear of cartilage in your hip or knee joint can cause the bones to rub together. This can cause pain, stiffness, and tenderness.
  • Deep vein thrombosis (DVT). DVT occurs when a blood clot forms in a vein. It most often happens in the thigh or lower leg.
  • Meralgia paresthetica. Caused by pressure on a nerve, meralgia paresthetica can cause numbness, tingling, and pain on the outer thigh.
  • Hernia. An inguinal hernia can cause pain where the groin and inner thigh meet.
  • Diabetic neuropathy. A complication of type 1 and type 2 diabetes, diabetic neuropathy is a type of nerve damage that causes pain, tingling, and numbness. It typically starts in the hands or feet, but can spread to other areas, including the thighs.

Calf pain can be caused by muscle and tendon-related injuries, conditions related to the nerves and blood vessels, and some health conditions.

Strained calf muscle

A strained calf muscle occurs when one of the two main muscles in your calf become overstretched. Muscle strains often occur as a result of muscle fatigue, overuse, or not warming up properly before running, biking, or some other kind of activity that involves your leg muscles.

You’ll usually feel a muscle strain when it happens. The symptoms typically include:

  • sudden onset of pain
  • mild swelling
  • limited range of movement
  • a feeling of pulling in the lower leg

Mild to moderate calf strains can be treated at home with rest, ice, and anti-inflammatory medications. More severe strains may need medical treatment.

Achilles tendinitis

Achilles tendinitis is another common injury that stems from overuse, sudden movements, or stress on the Achilles tendon. This tendon attaches your calf muscles to your heel bone.

Symptoms typically include:

  • inflammation near the back of your heel
  • pain or tightness in the back of your calf
  • limited range of motion when you flex your foot
  • swelling

Self-care treatment like RICE (rest, ice, compression, elevation) can help the tendon to heal.

Muscle cramps

Muscle cramps don’t only happen in your thigh. They can happen at the back of your calf, too.

A sudden, sharp pain is the most common symptom of a muscle cramp. It usually doesn’t last longer than 15 minutes. Sometimes, the pain can be accompanied by a bulging lump of muscle tissue beneath the skin.

Non-muscle-related causes

  • Deep vein thrombosis (DVT). As with the thigh, a blood clot can also form in a vein in your calf. Sitting for a long period of time is one of the biggest risk factors for DVT.
  • Peripheral arterial disease (PAD). Peripheral arterial disease is caused by the buildup of plaque on the blood vessel walls, which causes them to narrow. Symptoms can include pain in your calves when you walk that goes away with rest. You may also have numbness or a pins and needles feeling in your lower legs.
  • Sciatica. Damage to the sciatic nerve can cause pain, tingling, and numbness in the low back that stretches down to your calf.

Your leg muscles are some of the hardest working muscles in your body. Your upper leg includes seven major muscles. Your lower leg includes three main muscles, located behind your tibia or shinbone.

Pain in your thigh or calf can be caused by muscle or tendon-related injuries, as well as conditions related to the nerves, bones, or blood vessels.

To reduce your risk of muscle or tendon-related injuries, take the time to warm up your muscles before exercising or doing some kind of activity, and remember to stretch afterward.

Doing resistance exercises can also help build strength and flexibility in your leg muscles. Also, stay hydrated and try not to sit for too long.

If you have pain in your thigh or calf that’s intense, gets worse with self-care, or is accompanied by other symptoms, be sure to follow up with your doctor as soon as possible.