A small inline icon
Choose a small PNG and select the data URL output. The resulting string begins with data:image/png;base64, followed by the encoded file bytes.
Turn the original bytes of a small raster image into text. Copy a complete data URL, a raw Base64 string, or an HTML img element. Encoding happens locally and does not resize or re-encode the selected image.
PNG, JPEG, WebP, GIF, AVIF, or BMP; up to 24 megapixels. Original file bytes are encoded unchanged, including embedded metadata.
Use a data URL where an image URL is accepted. Use raw Base64 for a field that already specifies the image type. HTML output uses a fixed alt attribute; replace it with a description before publishing.
Selected files are processed in your browser. This tool does not upload image bytes or fetch remote image URLs. Clear the tool to release its local image previews.
Choose a supported raster image up to 5 MB and 24 megapixels.
Review the image preview, dimensions, and encoded character count.
Choose data URL, raw Base64, or HTML output.
Copy the output or download it as a text or HTML file.
Choose a small PNG and select the data URL output. The resulting string begins with data:image/png;base64, followed by the encoded file bytes.
Select raw Base64 when the receiving system has a separate MIME-type field. This removes only the data URL prefix; the encoded image bytes stay the same.
Base64 represents each group of three bytes using four characters, with padding for incomplete groups. The exact encoded character count is 4 × ceil(bytes / 3). A data URL also adds a short media-type prefix.
A data URL identifies the image MIME type and encoding. Raw Base64 contains only the encoded bytes. The HTML option wraps the data URL in an img element with a fixed alt attribute that should be replaced with useful alternative text.
Large embedded images make documents and source files harder to read and can prevent independent image caching. This tool limits original files to 5 MB and rejects vector or non-image content. Base64 is an encoding, not encryption or access control.
No. Raw Base64 text is roughly one-third larger than the binary image, plus any data URL prefix.
The original file bytes are encoded unchanged, so embedded metadata and supported animation data remain in the output. Be careful with location metadata before sharing.
An img src generally needs the complete data URL, including the media type and base64 marker. Use the data URL or HTML output option.
The tool reads and encodes the local file in your browser. It does not send the selected image to a conversion server.