Is the Sun really a medium size star? It is often said that the Sun is a medium size, or even dim star. Is this true?

According to this list of stars within 21 light years, there are, out of the closest 121 stars, only six brighter than the Sun. This means that the Sun is in the top 6%. If you also count brown dwarfs, the Sun ranks even higher. 

Doesn't this indicate that the Sun is actually a relatively large star?
It is true that a surprisingly large number of stars are smaller (and thus less massive) than the Sun. However, the stars that are bigger than the Sun are often much bigger.

Look at this chart:



Image courtesy of Wikipedia user Jcpag2012 under the Creative Commons Attribution-Share Alike 3.0 Unported license.

Notice how small the Sun is compared to some of the other stars. It's tiny! It is indeed a small star - in technical terms a main sequence dwarf.

However, despite its size, it is clear that there are many more stars less massive than the Sun that there are stars more massive than the Sun. Why? There are two reasons:


Lower-mass stars live longer.
More low-mass stars can form in a given region than high-mass stars.


Encyclopedia of Astronomy and Astrophysics

The distribution of masses can be quantified in an initial mass function, typically given in the form
$$\xi(m)=km^{-\alpha}$$

When you integrate this over a range of masses, you can find how many stars are within that range. Not surprisingly, this number gets lower and lower as you slide the endpoints to more massive stars. You can see this decrease from the fact that $\xi'(m)&lt;0$, so long as $k&gt;0$ and $\alpha&gt;0$ - which is assumed by the model, according to empirical data.