Q was a highly powerful entity from a race of omnipotent, godlike beings also known as the Q.
Q appeared to the crews of several Starfleet vessels and outposts during the 2360s and 2370s. All command level officers in Starfleet are briefed on his existence. One such briefing was attended by Benjamin Sisko in 2367. He typically appears as a Humanoid male (though he can take on other forms if he wishes), almost always dressed in the uniform of a Starfleet captain.
In every appearance, he demonstrated superior capabilities, but also a mindset that seemed quite unlike what Federation scientists expected for such a powerful being. He has been described, in turn, as "obnoxious," "interfering," and a "pest". However, underneath his acerbic attitude, there seemed to be a hidden agenda to Q's visits that often had the best interests of Humanity at their core.