RAW vs JPEG and dynamic range

In short
- RAW is the sensor's data before processing; JPEG is a finished, compressed picture.
- A typical JPEG stores 256 levels per color channel; a RAW file stores thousands.
- RAW lets you pull back bright skies and dark shadows and change white balance freely.
- JPEG is fine when the light is easy and you need small files fast.
What a RAW file is
A RAW file is a record of what each pixel on the sensor measured, plus notes about the camera settings. It is not yet a finished picture: colors have not been worked out, no contrast curve has been applied and no sharpening has been done.
That is why an unprocessed RAW often looks flat and dull. On this page you can see the same photo three ways: the unprocessed RAW, the RAW after editing, and the JPEG the camera made. The flat version holds the most information, even if it looks the worst.
What JPEG does
When you shoot JPEG, the camera does the processing for you: it sets white balance, adds contrast and saturation, reduces noise, sharpens, and then saves the result.
Two things are lost on the way. First, the image is reduced to 8 bits per channel. Second, it is compressed: fine detail the eye is unlikely to notice is thrown away to make the file smaller. Saving and re-saving a JPEG loses a little more each time.
Bit depth and file size
Bit depth is how many steps of brightness each channel can record. 8 bits gives 256 steps; 12 bits gives 4,096; 14 bits gives 16,384. More steps mean smoother gradients and more room to brighten or darken without banding (visible stripes in skies).
File sizes vary by camera, but roughly: a 24-megapixel JPEG is about 6–12 MB, while the RAW is about 25–35 MB. Compressed RAW options are smaller. These are approximate figures.
What you can recover from RAW
Highlights: a sky that looks pure white in the JPEG often still has cloud detail in the RAW, about one stop or so of headroom (approximate, it depends on the camera).
Shadows: dark areas can usually be brightened by several stops before noise becomes a problem.
White balance: in RAW it is just a setting you can change later with no loss. In JPEG it is baked in, and fixing it shifts colors less cleanly.
What RAW cannot fix: missed focus, motion blur, and areas that are truly clipped (completely white on the sensor).
Dynamic range
Dynamic range is the span from the darkest to the brightest tones that can be recorded with detail. It is measured in stops; each stop is a doubling of light.
A sunny scene with deep shade can span 15–20 stops. Modern large sensors record roughly 12–14 stops at base ISO, less at high ISO. When the scene is wider than the sensor, something has to clip: either the sky goes white or the shadows go black.
Phones get around their small sensors by HDR stacking: they take several quick frames at different exposures and merge them. This works well for still scenes but can leave ghosting on moving subjects.
RAW+JPEG, and when JPEG is fine
Most cameras can save both at once. You get a ready-to-share JPEG and a RAW to fall back on, at the cost of more storage.
JPEG is fine for even, soft light, for events where you will share hundreds of photos quickly, for sports bursts where buffer space matters, and when you are happy with how your camera renders color.
Choose RAW for high-contrast scenes, mixed or tricky lighting, night photos, and any shot you may want to edit seriously later.