Image to Base64 Converter

Turn images into base64 data URLs in your browser. Copy as data URL, CSS background, HTML img tag, or JSON.

Drop images here

Encode JPG, PNG, WebP, or AVIF as base64 data URLs locally. No uploads.

Use the file picker or drag image files onto this area.

Output format

Choose how the base64 is wrapped. The same source bytes work in every format.

0 items

Data URL works inline in HTML. CSS and HTML wrap it for templates. JSON for tooling.

Image to base64 notes

Private
Encoding runs in the browser. Images never leave this device.
Formats
Raw data URL, CSS background, HTML img tag, or JSON for tooling and templates.
Tradeoff
Base64 is ~33% larger than binary. Prefer it for small icons and inline assets.
Use cases
Email templates, single-file HTML, favicons in CSS, demo assets, and embeds.