An upload form asks for a JPEG, so you change badge.png to badge.jpg. The name now has the expected ending, but the image data is still encoded as PNG. A real format conversion creates new encoded data.
Use the Image Format Converter to export a copy in the requested format. Keep the original separately, and do not use the source label alone to decide what the file contains.
Separate the filename, type label and encoded image
The filename extension is the part after the final dot. A browser also supplies a type value, such as image/jpeg, when a file is selected. The encoded image data is a third thing: it is the content an image decoder reads.
These can disagree. MDN explains that browser file type values can be inferred from the extension rather than from inspection of the bytes. They can also vary with the computer’s configuration. The current converter builds its Detected source format label from that browser-supplied value; it is not an independent check of the encoded format.
Opening the picture successfully is not enough to prove that it has the format a receiving form requires. In our test, the browser could display both filenames even though their type labels differed.
What changed when we renamed the test PNG
We created an opaque 160 by 100 pixel PNG, then copied its exact bytes to a file ending in .jpg. In a local Chrome test using the current converter code, we selected the actual files through the browser file input.
| Selected file | Tool source label | Independently decoded format |
|---|---|---|
badge.png |
PNG | PNG |
badge.jpg, containing the same bytes |
JPG | PNG |
Both files were 598 bytes, and their full contents matched. Renaming had not converted anything. We then exported each through the tool as JPG at quality 85. Both new files were independently decoded as JPEG at 160 by 100 pixels, with a file size of 2,768 bytes. Those are measurements of one synthetic graphic, not a size or quality prediction for another image.
Create a real JPEG export
- Keep the original file and check the destination’s accepted formats. If it specifically requires JPEG, do not substitute another format merely because it displays correctly on your computer.
- Load the image in the converter. The current displayed input limit is 20 MB. If the file cannot be decoded or the picture is wrong, stop and return to a usable original.
- Select JPG under Convert to, even if a renamed input already has a JPG source label. The target selection requests a new encoding operation.
- Choose a quality setting, press Convert image and inspect the preview. Quality 85 was used for the controlled example; choose based on your own result.
- Confirm New format says JPG, then press Download converted. Save the new file where you can distinguish it from the renamed input.
The tool draws the decoded image to a canvas and exports a new file. MDN’s canvas export documentation describes how the requested format is supplied to the encoder. The converter reads the returned output type to set its new-format label and download extension.
Check the exported copy before uploading
Open the downloaded result and check the visible picture, dimensions and file size. If you need to identify the encoded format, use an image application that actually decodes the file and reports its format; a label inferred only from the filename can repeat the original mistake.
Choose the newly exported copy in the receiving form and inspect its preview. A genuine JPEG can still fail a separate size or dimension requirement. Our guide to exact image byte limits covers that measurement.
Changing the encoding also does not guarantee unchanged detail. Keep the original for future exports, especially when the image contains fine text or edges. Conversion solves the file-format mismatch; it does not by itself establish that the destination accepts the file.