Flip a JPG losslesslyFlip a JPG with zero quality loss
Mirror your JPG without saving it over again, so it stays exactly as sharp as before.
No photo handy?
FreeNo sign-upPhotos stay on your device
The compressed blocks are moved and their signs changed — nothing is decoded or compressed again, and the saved file is read back to prove it.
And which one this page uses
Three ways to write a flipped JPEG
Every flipped JPEG on the web is written one of three ways. Re-encode: decode the picture, flip the pixels, compress it again. Simple, universal, and a second generation of loss — the reason a JPEG flipped ten times looks worse. Tag: leave the picture alone and change the sixteen-bit EXIF orientation field, which tells viewers to show it mirrored. Nothing is lost, but a viewer that ignores the field shows the original. Blocks: move the compressed 8 × 8 blocks to their mirrored places and change the sign of the numbers that describe left-right (or up-down) detail. That is what the classic jpegtran -flip tool does, and it is what this page does by default, in the tab.
The block route has one rule that belongs to the format. Blocks are grouped into units of 8 or 16 pixels depending on the colour subsampling, and only whole units can move. If the picture’s width is not a whole number of units, the strip on the right has no partner; the page tells you its exact width and lets you leave it, trim it or switch to the tag route. A perfect flip is offered only when there is no strip.
Four steps
Running it
- Open the JPEG. The page reads its block layout straight away: the size of its block unit (8 or 16 px), its colour subsampling, and whether it is a baseline file it can move blocks in.
- Choose the axis. Left to right, top to bottom or both. The JPEG route is already set to move the compressed blocks, and the readout says whether every block can move.
- Decide about the edge, if asked. If the width (or height) is not a whole number of block units, a strip at the edge cannot move. Leave it in place, trim it off, or switch to the orientation-tag route.
- Save and check. The file is written without decoding, read back, and every coefficient compared. Check the saved file decodes it and compares it with the source mirrored.
Real numbers
A worked example
A 4032 × 3024 phone JPEG with 4:2:0 colour uses 16 px units: 4032 = 252 × 16 and 3024 = 189 × 16, so every block can move on either axis. It holds 190,512 brightness blocks and 47,628 of each colour, 285,768 in all. Flipping it left to right moves every one of them to its mirrored column, rebuilds the compression tables, and reads the result back: 0 coefficients changed. A 4000 × 3000 file flips left to right perfectly too (250 units), but top to bottom leaves an 8 px strip, because 3000 is 187½ units.
- Baseline JPEGs only. Progressive and arithmetic-coded files, 12-bit and multi-scan files are refused with the reason; the tag route or a re-encode still works.
- Reflections, not turns. Quarter turns are not written by moving blocks here; the tag route handles any of the eight orientations.
- Trimming is not reversible. A trimmed strip is gone. Leaving it keeps every pixel but leaves that strip unflipped.
- Decoders may differ by a level or two. The numbers in the file are exact; a browser's decoder can smooth subsampled colour slightly differently at block edges, which the check reports as measured rather than hides.
Asked often