Speaking strictly JPEG is not a file format but a standard developed by the Joint Photographic Experts Group (JPEG) but its ubiquitous nature means that it is referred to widely as a format. It uses compression algorithms to reduce the size of the image file by discarding data and then rebuilding the data when the file is opened; a type of compression known as "lossy."
Capable of being read by a very wide variety of computer applications on a variety of platforms, and supported by HTML, the standard computer language used to create web pages, JPEG is probably the most common image file format used. Apart from being highly convenient the small file size of an image saved in the JPEG standard compared with other formats such as TIFF, and NEF RAW, increases a camera's shooting capacity since more images can be stored on its memory card.
However, such convenience comes at a price. It is important to understand that images saved in the JPEG standard are processed by digital cameras according to the settings either you, or the camera selected at the time of the exposure. For example, whenever one of the current range of Nikon D-SLR cameras save a file as a JPEG, two key things happen to the data:
1) The 12-bit data from the sensor is converted to 8-bit. This will reduce the tonal range of the picture, which can be significant if you intend to perform a lot of processing on an image at a later stage.
2) Camera settings, such as the white balance, sharpening, tone, and hue are assigned to the JPEG by the camera. If, inadvertently, you select the wrong setting, you will need to rectify your mistake by post processing in a computer, but there is no guarantee this will be successful.
If you intend to print your pictures the best results are achieved with the larger file size and finer compression settings but if you want to post pictures to a web site or send them as an attachment to email select a smaller file size and higher compression.
Generally, Nikon digital cameras allow you to save JPEGs at three sizes:
L - Large
M - Medium
S - Small
For each file size you can assign one of three levels of compression (usually referred to as image quality):
FINE - uses a low compression of 4:1
NORMAL - uses a moderate compression ratio of 8:1
BASIC - uses a high compression ratio of 16:1
Note: JPEG compression can generate visual artifacts; the higher the compression ratio, the more apparent these become. If you are shooting for web publication this is unlikely to be an issue, but if you intend to make prints from your JPEG file pictures you will probably want to use the Large/FINE settings.