Desenvolvimento
Programming
Image to Base64
PNG and JPG
Upload a PNG or JPG image and get the Base64 string ready to use in HTML, CSS, JSON, or APIs. Useful for embedding icons without extra HTTP requests and sending images in REST payloads.
How to use
- 1Click the upload field and select a PNG or JPG image from your device.
- 2The corresponding Base64 string appears automatically in the result box.
- 3Use the 'Copy' button to paste the Base64 code directly into your HTML, CSS, or API.
- 4Click 'Clear' to remove the current image and convert another one.
Practical examples
Embed a small icon in CSS
Convert a PNG icon to Base64 and use the result in background-image: url('data:image/png;base64,...') without hosting the file.
Send an image in a REST API request
Convert the image to Base64 and include the string directly in the JSON body of a request that expects an encoded file.
Attach a logo to an HTML email
Generate the logo's Base64 string and insert it into an <img> tag's src attribute so the image shows up without external attachments.
Frequently asked questions
Which image formats are supported?
PNG and JPG are the primary supported formats. Other formats like WebP and GIF may work depending on the browser.
Is there a file size limit?
For best performance, we recommend images up to 1MB. Larger images generate very long Base64 strings and may impact application performance.
Is the image sent to any server?
No. The conversion happens entirely in your browser. No file is transmitted or stored externally.
