“O Captain! My Captain!” is generally iambic, meaning that the poem has an overall meter defined by the duh-DUM rhythm of the iamb. To get a sense of this iambic undercurrent, consider the opening stanza (lines 1–8):

     O Cap- tain! / my Cap-tain! / our fear- / ful trip / is done,
     The ship / has weath- / er’d ev- / ery rack, / the prize / we sought / is won,
     The port / is near, / the bells / I hear, / the people / all exult-ing,
     While foll- / ow eyes / the stead- / y keel, / the vess- / el grim / and dar-ing;
                              But O heart! / heart! heart!
                                 O the bleed- / ing drops / of red,
                                    Where on / the deck / my Cap- / tain lies,
                                       Fall-en / cold and / dead.

Although the rhythm here is generally iambic throughout, close analysis of this stanza reveals that Whitman introduces two forms of metrical variation. The first form of variation relates to line length. The first four lines of each stanza are all quite long, consisting of five to seven feet. Meanwhile, the final four lines of each stanza are all quite short, consisting of three to four feet. The second form of metrical variation relates to shifting stress patterns and the insertion of extra syllables. Whitman complicates the iambic meter from the get-go, with the galloping rhythm of “O Cap-tain! / my Cap-tain!” He introduces more variation in the second half of the stanza. These lines feature a spondee (stressedstressed; here, “heart! heart!”), an anapest (unstressed–unstressed–stressed; here, “O the bleed-”), and two trochees (stressed–unstressed; here, “Fall-en / cold and”).

As the passage quoted above clearly shows, each stanza in the poem is broken into two halves that are visually distinct due to drastically different line lengths. Significantly, the instances of metrical variation are more numerous and pronounced in the second half of each stanza. In the opening stanza, for instance, the first four lines are written in an iambic rhythm that is strict and consistent throughout, the only exception being the opening two feet of the first line. The metrical regularity of these lines reflects the general tone of positivity and hope that the speaker is expressing about a long and dangerous journey finally coming to an end. In the stanza’s second half, however, the meter mimics the speaker’s dramatically shifting mood. Now lamenting the death of the ship’s captain, the speaker speaks in lines that are significantly shorter and rhythmically inconsistent. This inconsistency powerfully reflects the speaker’s emotional turmoil.