Your DSLR camera sensor needs light to create an image. There are two ways it can get the light that it needs: keeping the shutter open for a long period of time or by opening the aperture as wide as possible.
The lens aperture is an adjustable control that determines the width of the opening that admits light to the sensor. The wider the aperture, the more light that can reach the sensor, making it possible to take pictures in dimmer light. The easiest way to imagine this is to think of an aperture as the pupil of your eye. When it’s bright outside, your pupils contract, letting in less light. When it’s dim, your pupils dilate. A narrow aperture reduces the amount of light that reaches the sensor, letting you avoid overloading the imaging device in very bright light. Aperture is used in tandem with shutter speed to control the exposure; and is measured in f-stops.
F-stops are a bit more confusing because the numbers appear off. This is the standard sequence of f-stops from f/1 to f/32. Also, each of these f-stops has precisely the same halving/doubling relationship as the shutter speed sequence.
1 1.4 2 2.8 4 5.6 8 11 16 22 32
When we look at it, going from f/4 to f/5.6 doesn't really sound like halving the amount of light. What's more, 5.6 is a larger number and sounds like it ought to be more light, not less. Neither does f/4 to f/2.8 sound like doubling the amount of light. But each number in this sequence is halving or doubling the amount of light from its immediate neighbor.
The reason why it doesn’t makes sense is because f-stop is a ratio between the diameter of the aperture in the lens and the focal length of the lens.
Example: on an 50mm lens, f/2 is saying that the diameter of the aperture is 25mm (because 50/2 = 25). But what is the area of that aperture? Because aperture forms a roughly circular hole, we will use the formula for the area of a circle (π * radius^2) to calculate that. Moving on, our 50mm lens at f/2 has an aperture diameter of 25mm, which is a radius of 12.5mm. Now put the radius in the formula above, and you will get: π * 12.52, or 3.1415 * 156.25, which gives us 490.85 sq mm.
Now let’s do the same with f/2.8.
50 (mm lens) /2.8 = 17.85. Now we need to divide 17.85 (the diameter) by 2 to get the radius, which is 8.92. And simply put it in the formula to get π * 8.922, which is equal to 249.95 sq mm.
Round it off a bit, f/2 was 500 sq mm and f/2.8 is 250 sq mm.
A double/half relationship. So practically the area of the hole in the lens doubles and halves. In our case 500 sq mm at f/2, and 250 sq mm at f/2.8, where the latter is 2x smaller than f/2, so 2x smaller hole means 2x less light – making sense now?
Of course if you do the math on a 300mm lens, f/2 will give you a way different number. But does that mean that f/2 on a 300mm lens lets in more or less light than f/2 on a 50mm lens? NO! The lens makers figure out all these things and just mark the f-stops on the lens for us. So f/4 has the same brightness on a 50mm, 100mm or even 300mm lens. Pretty cool, huh?
Now the larger the f-stop (the smaller the number), the more light that is admitted, but less of your image will be in focus (shallow depth of field). The smaller the f-stop (larger the number), the less light that is admitted, but more of your image will be in sharp focus. An f/2 lens (small number, large f-stop) is a fast lens, whereas one with a maximum aperture of f/5.6 (larger number, smaller f-stop) is slow. If you need to take photos in dim light, you want to buy a fast lens.
As the f-stops get smaller (larger number), exposure time must be increased to let in the same amount of light. For example, if you take a photo at f/2 for 1/2 second, you need to double the exposure time to one full second if you stop down (reduce the aperture) to f/2.8.
All lens apertures can be narrowed down to f/22. But not every lens can be opened up to f/1.4. The limit to how wide a lens can be opened is called the maximum aperture. Also the wider a lens opens, the more it costs, and the heavier it gets.