b2KIT

Image Orientation Fixer

Fix image orientation based on EXIF rotation data so photos display correctly.

Tested tool guide Tested browser tools Checked August 16, 2026

What Image Orientation Fixer does, with a checked example

A photo can be upright in one app and sideways in another while the pixels are identical. The difference is one EXIF tag: Orientation tells a viewer how to transform the stored pixels before drawing them, and viewers differ on whether they honor it. This tool makes the fix permanent: it applies the rotation the tag describes to the pixels and resets the tag to normal, so the file displays upright in every viewer and print service, and nothing downstream can rotate it twice. It all runs in the browser; the photo never leaves your machine. What users get wrong: they expect only the orientation to change, but a JPEG is re-encoded, and size and quality shift slightly.

Worked example

A concrete input and expected output from the current implementation.

Input

A portrait photo taken with a phone, stored as 4032x3024 pixels with an EXIF Orientation tag of 6, which displays sideways in viewers that ignore the tag.

Expected output

A corrected file whose pixels are now 3024x4032 (rotated 90 degrees clockwise) and whose Orientation tag is rewritten to 1, so it displays upright in every viewer, including ones that ignore EXIF.

Orientation value 6 means the stored pixels must be rotated 90 degrees clockwise to display correctly, so the fixer applies that rotation, which swaps width and height, and writes the tag back as 1. Leaving the tag at 6 would make EXIF-aware viewers rotate the already-corrected photo a second time.

How the result is produced

1

Reading the orientation tag

A JPEG stores EXIF metadata in a block inside the file. The relevant entry is Orientation (0x0112), an integer 1 through 8: 1 is normal, 3 is 180 degrees, 6 is 90 degrees clockwise, 8 is 90 degrees counterclockwise, and 2, 4, 5, 7 are mirror variants. The tool locates the tag, reads the value, and determines the transform it calls for. A value of 1, or a file with no tag at all, means there is nothing to correct.

2

Rewriting the pixels

The correction is a geometric transform of the pixel grid: a 90-degree rotation swaps width and height, 180 degrees keeps the dimensions, and the mirror values flip the grid. The tool builds a new file from the transformed pixels with the Orientation tag reset to 1, so no later viewer applies the rotation again. The image is re-encoded in the process, which for JPEG means a lossy recompression: the photo looks the same, but size and quality shift slightly.

Good uses

  • A portrait phone photo displays sideways in an email client or chat app: run it through the fixer once, and the rotation is baked into the pixels so it opens upright everywhere, including viewers that ignore EXIF.
  • Batch-prepare photos for a website, gallery, or print service that strips or ignores EXIF metadata, so the orientation you see while selecting is the orientation that ships.
  • A photo renders upright in some browsers but sideways in others because display-time EXIF handling differs: normalizing the file to an Orientation tag of 1 makes every renderer produce the same result.

Limits and checks

  • No tag means no fix. If an editor rotated the photo and dropped the EXIF data, or the file is a screenshot, there is no orientation signal to act on: the tool cannot infer the intended rotation from the pixels and has nothing to correct.
  • The output is a new compression. For JPEG, the corrected file is re-encoded lossily, so quality and file size change slightly even though the photo looks identical; keep the original as the master if you may edit further, since each fix-and-save cycle compounds the loss.
  • The tag states the transform, not the history: 6 does not mean the camera was held 6 degrees off, it means rotate the stored pixels 90 degrees clockwise before display. If the tag in the source file is itself wrong, the corrected output will still be wrong, and no pixel-based check can catch that.

Common questions

Will fixing the orientation damage my photo?

For JPEG, the output is re-encoded and JPEG compression is lossy, so the corrected file is a new generation of the photo: it looks identical, but it has been compressed again. Keep the original file as your master copy and treat the fixed file as a display copy. Formats like PNG that carry orientation metadata can be re-encoded without loss.

My photo is sideways but the tool says there is nothing to fix. Why?

If the file has no Orientation tag, the sideways appearance comes from a rotation whose metadata was stripped, which is common after edits and screen captures. The tool only acts on the tag; it cannot deduce the intended rotation from pixel content, so it correctly leaves the file alone. Rotate it with an editor instead and save the result.

References and verification

The example and behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.

Related Tools