JPEG is an image format that compresses photographs into small files by removing detail your eye is unlikely to miss. It is the format behind most photos you see online, named after the Joint Photographic Experts Group that created it in the early 1990s.

Think of it like packing a suitcase by rolling clothes tightly instead of folding each item perfectly. You fit far more in, and from a distance it looks fine, but some neatness is lost for good. JPEG works the same way: it groups similar colours and smooths fine gradients, which is great for a sunset photo but messy for sharp logos or text. For those, a PNG keeps every pixel exact. JPEG only stores RGB colour, so it is built for screens rather than print.

The trade-off is compression level. Save at high quality and a JPEG looks identical to the original at a fraction of the size. Push the compression too hard and you get visible blocks and halos around edges, the classic sign of an over-squeezed image.

One practical habit saves a lot of grief. Because JPEG is lossy, every save loses a little more, so never edit a JPEG, save it, then edit that same file again the next day. Keep your original as a PNG or a camera raw, treat the JPEG as a final export, and re-export from the master whenever you need a new size. That also matters for responsive design, where the same photo ships in several widths for phones, tablets and desktops.

At TopDevs we pick the right format per image and compress JPEGs automatically during the build, so a client’s product photos stay sharp while the page still loads fast.