Four muscles extend the knee and at least nine muscles contribute to flexing it. The extensors are the four heads of the quadriceps on the front of your thigh, while the primary flexors are the hamstrings on the back. Several smaller muscles also assist with knee flexion, each adding stability or rotation alongside their bending force.
The Quadriceps: Your Knee Extensors
The quadriceps femoris is the only muscle group that straightens (extends) the knee. As the name suggests, it has four heads that merge into a single tendon attaching just below the kneecap:
- Vastus lateralis: the largest head, running along the outer thigh
- Vastus medialis: the inner thigh portion, especially important for the last few degrees of full extension and for keeping the kneecap tracking properly
- Vastus intermedius: a deep layer sitting directly on the front of the femur, hidden beneath the rectus femoris
- Rectus femoris: the only head that crosses both the hip and the knee, meaning it also helps flex the hip
All four heads are supplied by the femoral nerve, which arises from spinal nerve roots L2 through L4. Because a single nerve controls the entire group, an injury to the femoral nerve can weaken or eliminate knee extension altogether.
How the Kneecap Helps Extension
The patella sits inside the quadriceps tendon like a pulley, changing the angle at which the tendon pulls on the shinbone. This shifts the mechanical advantage of the quadriceps depending on how bent your knee is. Near full extension, the kneecap amplifies the force the quadriceps can produce, giving you that final “locking” power at the top of a squat or leg press. Through most of the bending range, however, the kneecap actually amplifies speed rather than force. During walking and running, the effect is almost entirely speed-amplifying, which helps you snap the lower leg forward quickly with each stride.
The Hamstrings: Primary Knee Flexors
The hamstrings run down the back of the thigh and are the main muscles responsible for bending the knee. The group has four distinct parts:
- Biceps femoris long head: crosses both the hip and knee, sitting on the outer side of the back of the thigh
- Biceps femoris short head: the only hamstring that crosses only the knee, not the hip
- Semitendinosus: a long, rope-like muscle on the inner side with the longest leverage arm of any hamstring at both the hip and knee, making it a particularly strong contributor to knee flexion torque
- Semimembranosus: a broader, flatter muscle beneath the semitendinosus, with a longer leverage arm at the knee than the biceps femoris long head, giving it strong bending capacity
The three bi-articular hamstrings (all except the short head) are innervated by the tibial division of the sciatic nerve, which originates from spinal roots L4 through S3. The short head of the biceps femoris takes a different path: it’s supplied by the common fibular (peroneal) division of the same nerve. This split matters clinically because certain nerve injuries can knock out part of the hamstrings while leaving the rest intact.
Because the bi-articular hamstrings cross both joints, their effectiveness at the knee depends on hip position. When your hip is flexed (think: seated or bent forward), the hamstrings are stretched across the hip and can generate more knee flexion force. When the hip is extended, they’re slackened and contribute less.
Secondary Knee Flexors
Several muscles outside the hamstring group also bend the knee, though none of them are powerful enough to do the job alone.
Gastrocnemius. This large two-headed calf muscle is best known for pointing the foot, but because it originates above the knee on the back of the femur, it also pulls the lower leg into flexion. You can feel it engage during activities that combine knee bending with ankle push-off, like jumping or sprinting. The smaller plantaris muscle, a thin slip running alongside it, does the same thing on a much smaller scale.
Sartorius and gracilis. Both cross the inner side of the knee and contribute flexion along with internal rotation of the lower leg. They’re important stabilizers of the medial knee. The sartorius is the longest muscle in the body, running diagonally from the outer hip to the inner knee, while the gracilis travels straight down from the pubic bone.
Popliteus. This small, flat muscle sits directly behind the knee joint and plays a unique role. When you’re standing with a fully straight knee, the joint locks into extension through a slight outward twist of the shinbone (sometimes called the “screw-home mechanism”). The popliteus is the muscle that unlocks that twist. It internally rotates the tibia relative to the femur, initiating the first few degrees of bending. Without the popliteus, transitioning from a locked, straight knee into a squat or step would feel stiff and difficult.
How Flexors and Extensors Work Together
Knee movement is never purely the work of one group. When you walk, the quadriceps fire to straighten the knee as your foot swings forward, then the hamstrings activate to decelerate that swing just before your heel strikes the ground. This braking action is actually where hamstring strains most commonly happen: the muscles are lengthening while trying to produce force, putting them under high tension.
During a squat, both groups are active simultaneously. The quadriceps control the lowering phase and power the ascent, while the hamstrings stabilize the knee and assist with hip extension at the bottom. The gastrocnemius co-contracts to keep the ankle stable. Even the popliteus quietly fires during the initial descent to unlock the knee from full extension.
Strength imbalances between these groups are a common source of knee problems. A hamstring-to-quadriceps strength ratio below roughly 60% is frequently flagged as a risk factor for knee injuries, particularly tears of the anterior cruciate ligament. Training both groups through their full range of motion, not just in the positions where they’re strongest, helps keep the joint protected.
What Happens When These Muscles Are Injured
Muscle strains around the knee are graded on a three-point scale. A grade 1 strain means the fibers are stretched but not torn, and recovery typically takes a few weeks. A grade 2 strain involves a partial tear and can sideline you for several weeks to a couple of months. A grade 3 strain is a complete rupture that may require surgical repair and months of rehabilitation.
Hamstring strains tend to occur during explosive movements like sprinting, while quadriceps strains are more common during sudden deceleration or kicking. Because the rectus femoris crosses two joints, it’s the most frequently strained head of the quadriceps. Among the hamstrings, the biceps femoris long head is the most injury-prone, partly because the two heads of the biceps are controlled by different nerve branches and can be pulled in slightly different directions during high-speed movement.

