Convert an image between PNG, JPEG and WebP

Add or remove image data-URL wrappers, or re-encode browser-decodable raster images through canvas.

freeworks offlinenothing uploaded
ToolImage Format Converter
Input
Output

How it works

Text-only modes manipulate a Base64 media-type prefix. Raster modes decode an image, draw it onto canvas, and call the browser encoder for PNG, JPEG, or WebP; PNG-to-JPEG first paints white because JPEG has no alpha channel.

  • JPEG begins at a 0.92 quality hint and WebP at 0.8, both editable.
  • Encoder implementation and unsupported-format fallback belong to the browser.

Worked example

Flatten a transparent PNG for JPEG
Input
											Source: PNG with transparent pixels
To: JPEG
Background: #ffffff
										
Output
												JPEG data URL with transparent pixels replaced by white
											

When to use this

Web assets move from PNG to WebP, inline previews use data URLs, and transparent artwork is flattened for JPEG delivery.

Edge cases

  • A Base64-looking string may still contain bytes that do not match the selected image media type.
  • JPEG export irreversibly replaces transparent pixels with white.
  • Re-encoding a lossy source cannot restore details discarded by its earlier compression.

References