The highest rank in pilot is Captain.
According to the provided reference, a captain is the highest-ranking official on an aircraft. They are responsible for operating the airplane and ensuring the safety of everyone on board. While captains can perform the same duties as co-pilots, they also have additional responsibilities as the first-in-command on each flight.
In summary, a captain holds the ultimate authority and responsibility on an aircraft.