Base64 Image Optimizer

Paste or upload a Base64 image and get back a smaller one. Control output format, maximum width and height, and quality — the tool re-encodes the image through the Canvas API. Handy for shrinking inline data URIs in HTML, CSS or JSON payloads.

How to use

1

Paste or upload the Base64 image

Paste a data URI or raw Base64, or upload a file.

2

Set output options

Choose format, max width, max height and quality.

3

Click Optimize

The tool re-encodes the image with the chosen settings.

4

Copy the result

Copy the optimized Base64 or data URI to your clipboard.

80%

Everything runs in your browser. Your image data never leaves your device.

Base64 input
Optimized base64

Features

Format conversion

Convert between PNG, JPEG, WebP, GIF, BMP and AVIF (output limited by browser support).

Resize and compress

Control max width, max height and quality to shrink the encoded string.

Size comparison

See original and optimized size side by side.

Auto-format detection

Detects the input format from the data URI or magic bytes.

Common use cases

  • Shrink a Base64 image embedded in HTML
  • Compress a data URI before adding it to a CSS file
  • Resize an inline base64 image for an email template
  • Convert a large Base64 PNG to a smaller WebP

Frequently Asked Questions

Related tools