Starfleet captains
In the history of Starfleet, many officers held the rank of captain or held the title of  while commanding starships.

According to Travis Mayweather, Matthew Ryan spent more time in space than most Starfleet Captains. ()

List of prime reality captains

Senior captains

Starfleet flag officers sometimes retained or took command of a vessel. Most often, these officers held the rank of commodore, but there were instances of admirals operating as starship captains.
 Rear Admiral  ()
 Commodore  ()
 Commodore  ()
 Fleet Captain Garth (Garth's starship)

Captains
The substantive rank of captain was typically held by officers captaining starships. Officers of this rank also sometimes served in other capacities, such as in command of starbases or divisions of support personnel (such as JAG officers or members of the Starfleet Corps of Engineers), or as members of experimental engineering programs.

22nd century

  ()
 Brody (Saratoga)
 Duvall (Shenandoah)
   ()
 Gardner (NX Program)
 Hernandez ()
  (NX Program)
 Jennings (Republic)
  (Intrepid)
  (NX Program)
  ()
  (Earth-Romulan War)

23rd century

  ()
  ()
  (Instructor; , STC, Starfleet Academy)
 
 
  ()
  ()
 Garrovick ()
 Garth (Garth's starship)
  ()
  ()
  (Instructor; Beam Technology, STC, Starfleet Academy)
  ()
  ()
  ( and )
  ()
 Krasnovsky
  ()
  ()
 
  (Instructor; Beam Technology, STC, Starfleet Academy)
  ()
 O'Shea ()
  ( and )
 Ramart (Antares)
  ()
  ()
  (Captain of engineering,  and )
 Spock ()
  ()
  ()
  ()
  ()
  (Starbase 5)
  ()
 Xon (STC, Starfleet Academy)

24th century

  ()
 
 Amasov ()
  ()
  ()
  (Warp Technologies Development Group)
  ()
  ()
  (Seventh Tactical Wing)
 Benteen ()
 Blackwood ()
  ()
  (Flight instructor, Starfleet Academy)
 
  (; Fleet Yards Operations)
 
  (Fleet Yards Operations)
  (Fleet Yards Operations)
  (Research & Development)
  (Advanced Technologies Group)
 
 Conklin ()
  (Warp Technologies Development Group, Starfleet Operations)
  ()
 Darson ()
  ()
  (Orbital Operations)
  ()
 Diego (Diego's starship)
  ( and Science Ops)
 Durango ()
  (Engineering Group)
 Edwell
 Entebe ()
 Fleck, Jerry (Flight Ops Officer, Starfleet Academy)
  ()
  ()
  ()
  ()
  ()
  ()
  ()
  ()
  ()
  ()
  ()
  ()
  ()
 
  (Starfleet Operational Support Services)
  (Warp Technologies Development Group)
 
  (; Engineering Corps)
  ()
  ()
  ()
  ( and )
  (Yard Engineer)
  ()
 Keogh ()
  ()
  ()
 Laporin (Laporin's starship)
  ( and Warp Technologies Development Group)
 Leyton ()
  ()
  (Wing commander, Starfleet Academy)
  (AR-558)
 
  (Judge Advocate General, Sector 23, Starbase 173)
  ()
  ( and )
 McCoullough
  (; Engineering Corps)
  (Engineering Group)
  ()
  (Warp Technologies Development Group)
 Narth ()
  (Starfleet Academy)
  (Warp Technologies Development Group)
  ()
  ()
  ()
  (Stellar Imaging Division)
  ()
  (, , and )
  ()
  ()
  ()
  (Engineering Corps)
   ()
  ()
  ()
 Raymer ()
 Raymond ()
 Reynolds
  ()
  ()
 
 Rifkin (Rifkin's starship)
  (, , and ) (Starfleet Reserve as of 2390s)
  ()
  (Stellar Imaging Division, Research and Development)
  ()
  ()
 Satelk
  ()
  ()
  (NCC-31810)
  (Deep Space 9,  and )
  ()
  ()
  (Orbital Operations)
 Stadius
  ()
  ()
  ()
 
  ()
  ()
  ()
  ()
  ( and ; Engineering Corps)
  ()
  ()
  ()
  ()
  ()
  ()
  (Yard Engineer)
  (Fleet Ops)
  ()
 Zimbata ()
  ( and )

25th century 

  ()

31st century 
 ()

32nd century
Bandra ()
 ()
Imahara ()

Rahma
Saru (USS Discovery)

Junior captains

According to the rules of naval parlance, a person of any officer rank could be addressed as captain if they were assigned as sole commanding officer of any starship. Captains could also have been awarded provisional (brevet) ranks or field promotions to be accorded the title of captain.

Commander  (, , and )
Lieutenant Commander Data ( and )
Lieutenant Commander  ()
Lieutenant Commander Piersall ()
Cadet  ()

Unnamed captains

Chakotay's first captain
USS Enterprise-B launch spectator, 2293 ()
USS Defiant captain (; )
USS Jenolan captain ()
USS Lalo captain ()
USS Saratoga captain ()
USS Saratoga captain ()
Starfleet Command aide-de-camp ()
Starfleet Command briefing attendee ()
Transport captain commanded the starship that transported Benjamin and Jake Sisko to Deep Space 9 in 2369. ()
USS Venture captain ()
Yar's commanding officer ()
32nd century captains
Alien captain 1
Tellarite captain
Cardassian captain
Ckaptir captain
Human captain 1
Human captain 2
Human captain 3
Human captain 4

List of alternate reality captains

Senior captain
Starfleet flag officers sometimes retained or took command of a vessel.
Admiral  ()
Admiral  ()

Captains
The substantive rank of captain was typically held by officers captaining starships. Officers of this rank also sometimes served in other capacities, such as members of experimental engineering programs.
 ()
 ( and )
 ()
 ()

Junior captains 
According to the rules of naval parlance, a person of any officer rank could be addressed as captain if they were assigned as sole commanding officer of any starship. Captains may have also been awarded field promotions to be accorded the title of captain.
Commander  ()
Lieutenant Commander  ()
Lieutenant  ()

Unnamed captains
Daystrom Conference Room meeting attendee ()
Starfleet Headquarters secret meeting attendee ()
Yellowstone-class presentation female ()
Yellowstone-class presentation male ()

List of mirror universe captains

Captains
 ()
 ()
 ()
 ()
 ( and )
Maddox ()
 ()
 ()
Spoeneman ()
 ()

De facto captain (not recognized by the Terran Empire)
 (ISS Defiant)

Unnamed captain

ISS Avenger captain ()

List of parallel universe captains

A list of captains seen in alternate timelines and parallel universes:

Senior captain
In at least one parallel universe, Starfleet flag officers sometimes retained or took command of a vessel.
Admiral  () ()

Captains
Braxton (Aeon and )
 ()
 () ()
 () ()
 () ()
 () ()
Nog ()
 () ()
 (Intrepid)
 ()
 ()
T'Pol ()
 ()

cs:Kapitáni Hvězdné flotily
de:Liste von Captains der Sternenflotte
ja:宇宙艦隊の大佐
Captains
 01