Few passages in the Bible get quoted in as many disconnected pieces as Psalm 23. One line ends up on a sympathy card, another on a framed print, a third in the program handed out at a memorial service. Each fragment stands fine on its own, and that is exactly why almost nobody who has ever heard "the LORD is my shepherd" has read the whole psalm start to finish. Below is the complete psalm — read it straight through, or listen to it narrated while you follow along — and after that, verse by verse, what each part actually says, including the piece most explanations rush past: the valley.

Psalm 23, in full

The LORD is my shepherd; I shall not want. He makes me lie down in green pastures; He leads me beside quiet waters. He restores my soul; He guides me in the paths of righteousness for the sake of His name.
Psalm 23:1-3
Even though I walk through the valley of the shadow of death, I will fear no evil, for You are with me; Your rod and Your staff, they comfort me.
Psalm 23:4
You prepare a table before me in the presence of my enemies. You anoint my head with oil; my cup overflows. Surely goodness and mercy will follow me all the days of my life, and I will dwell in the house of the LORD forever.
Psalm 23:5-6

Who wrote Psalm 23, and when

Unlike Psalm 91, which carries no title at all in the Hebrew text, Psalm 23 opens with a direct attribution: "A Psalm of David" — mizmor le-David, in the original. It is a short heading, but one that changes where the reading starts, because it ties the text explicitly to Israel's second king, and that is how Jewish and Christian tradition alike have always read the psalm.

One technical caveat is worth noting, without turning it into more doubt than it deserves: the Hebrew particle le, in "le-David," can indicate authorship ("by David"), but it can also mean "for David," "about David," or "in the style of David," depending on context — the same particle shows up in other psalm titles with different senses. Most scholars, even so, read "le-David" here as an authorship claim, and David's own biography backs that reading up: before he was anointed king, he tended his family's flock near Bethlehem (1 Samuel 16:11). According to 1 Samuel 17:34-36, it was on that job that David says he fought off a lion and a bear to protect the sheep. The same figure of a shepherd risking his own safety for the flock shows up again, years later, in a psalm apparently written from the opposite side of that picture — the sheep trusting the shepherd.

Psalm 23:1-3 — the shepherd image in ancient Israel

The LORD is my shepherd; I shall not want. He makes me lie down in green pastures; He leads me beside quiet waters. He restores my soul; He guides me in the paths of righteousness for the sake of His name.
Psalm 23:1-3

In ancient Israel, shepherding was work built on near-total dependence between flock and shepherd. Sheep could not reliably find pasture or safe water on their own, could not defend themselves well against predators, and strayed easily off any route the shepherd had not marked out for them. "I shall not want," in verse 1, is not a promise of abundance or luxury — it is a statement of basic security, the kind that makes sense coming from someone who depends entirely on another to eat, drink, and make it through the day alive.

Verse 2 picks its images carefully. Sheep, unlike cattle, avoid moving water — the noise and current unsettle them, and an experienced shepherd had to find or dam still pools so the flock would drink without fear. "Green pastures" and "quiet waters" describe abundance, but they describe calm even more: a pace set by the shepherd, not by urgency or herd instinct. Verse 3 shifts registers — from physical care to inner restoration. "He restores my soul" and "He guides me in the paths of righteousness" are about moral direction, not just geography, and the closing phrase of the verse, "for the sake of His name," ties that guidance to the shepherd's own reputation, not to anything the sheep has earned by following.

Psalm 23:4 — the valley of the shadow of death

Even though I walk through the valley of the shadow of death, I will fear no evil, for You are with me; Your rod and Your staff, they comfort me.
Psalm 23:4

Up to this point, the psalm talks about the shepherd in the third person — "He makes me," "He leads me," "He restores." In verse 4, the voice shifts to the second person — "You are with me" — and stays there for the rest of the poem. The shift happens right at the moment danger enters the scene: while describing pasture and water, the sheep talks about the shepherd; once the valley appears, it starts talking to him.

The Hebrew phrase behind "shadow of death," tsalmaveth, has been argued over for decades among Old Testament scholars. One traditional reading treats it as a compound of "shadow" and "death," which supports the classic translation. Another reading, held by a good number of modern scholars, argues it is an intensive Hebrew form for "deep darkness," with no direct link to the word "death" at all — which is why some newer translations render it "the darkest valley" instead of "the valley of the shadow of death." Both readings have serious defenders, and neither changes the verse's overall sense: a place of real danger, dark enough to be frightening. What the verse does not do is promise a detour. It says "I walk through" the valley, not "I walk around" it — the protection described applies to the crossing itself, not to a route that avoids the danger.

"Rod" and "staff" are two distinct tools of the shepherding trade, and the psalm names them together on purpose. The rod was short and heavy, used to beat back predators and defend the flock against outside attack. The staff was long, with a crook at the end, used to guide the sheep and pull back any that wandered off from the group or slipped into a crevice. One tool defends from outside; the other rescues from within. Together, they cover the two kinds of risk a shepherd has to manage — the attack that comes from outside, and the straying that comes from the sheep itself.

Psalm 23:5 — "You anoint my head with oil"

You prepare a table before me in the presence of my enemies. You anoint my head with oil; my cup overflows.
Psalm 23:5

Verse 5 switches images without warning: the shepherd and the sheep disappear, and in their place stand a host and an honored guest at a table. Anointing a visitor's head with oil was part of the customary hospitality of the ancient Near East — a welcoming gesture so expected that leaving it out was noticed as a real slight, as it is later in Luke 7:46, when Jesus points out that a host failed to offer him that same gesture. A full table, an overflowing cup, and an anointed head together form the picture of someone treated as an honored guest, not a fugitive.

The detail that gives the verse its weight is the second half: all of this happens "in the presence of my enemies." Not after the danger passes, and not far from it — in the middle of it, with the threat still close enough to be watching. The abundance described is not a reward that arrives once the threat backs off; it happens inside the risk itself, while it is still underway.

Psalm 23:6 — "goodness and mercy will follow me"

Surely goodness and mercy will follow me all the days of my life, and I will dwell in the house of the LORD forever.
Psalm 23:6

The verb behind "will follow me," in the original Hebrew, most often comes from a root that means "to pursue" or "to hunt down" — the same word used elsewhere in the Old Testament for an enemy chasing its prey. The effect of the verse is a deliberate reversal: the same intensity of pursuit that, in verse 4, could belong to a threat, here belongs to goodness and mercy, chasing the psalmist for the rest of his life.

It is worth noting a translation difference in how the psalm closes. The Berean Standard Bible, used here, renders the last line as "I will dwell in the house of the LORD forever." A handful of other English translations, and several translations used for the Portuguese and Spanish editions of this same psalm, render the underlying phrase as "for many days" or "for length of days" instead. The Hebrew phrase itself, le'orekh yamim, literally means "for length of days," and it genuinely supports both readings — a whole lifetime, or an eternity — without the Hebrew alone settling which one the text has in mind. Both translations are legitimate; it is worth knowing the difference when comparing versions.

What Psalm 23 promises — and what it does not

The psalm already answers this question, in its most quoted verse. It does not say the valley of the shadow of death will be avoided — it says it will be walked through. The central promise of the whole text is presence ("You are with me"), not the absence of danger, illness, or death. Centuries later, the New Testament picks up the same image from another angle: in John 10:11, Jesus describes himself as "the good shepherd," who "lays down his life for the sheep" — a re-reading that reinforces, once again, presence and self-giving, not exemption from risk.

When people search for this psalm

Psalm 23 is, alongside Psalm 91, one of the most-read texts at Christian funerals and memorial services — and it is worth understanding why it works in that moment without reaching for stock phrases. It does not deny fear: the text itself names the valley, the shadow, the enemies. It also does not promise an explanation for the loss, or rush the person grieving toward feeling better. What it offers is the language of company — "You are with me" — at a moment when explanations tend to sound hollow and the one true thing left is not being alone. That is why the psalm shows up as often in farewells as it does in hospital waiting rooms, the night before a surgery, or the hours when fear grows on its own in the quiet. None of these uses is wrong; the caution is the usual one — read the psalm as a place of refuge and company, not as a guarantee of outcome.

Keeping it together

In Terra Gospel you can highlight any section of Psalm 23 in one of four colors, write your own note, and keep it all under Favorites, so the verse you needed once is easy to find again. Reading, highlights, notes, favorites and the verse of the day are free in English, Portuguese and Spanish; the narrated audio Bible — including Psalm 23 read aloud, with background music and adjustable speed — is part of Premium.