Convert an image to Base64

Encode an image’s original bytes as a data URL or raw Base64 text.

Stays on your device · never uploaded. How to verify

Drop a file here

JPG, PNG, WebP, GIF, AVIF, BMP, SVG or HEIC · Up to 10 MB

Encode a small compass icon

The same icon shown from its Base64 image data
The same icon shown from its Base64 image data · 8.4 KB
A small compass icon saved as PNG
A small compass icon saved as PNG

Download the example TXT

Pick the text form your destination expects

Use a data URL when the destination accepts a media type and the actual image bytes in a single string. It begins with a prefix such as data:image/png;base64, followed by the text encoding. Choose Raw Base64 if a field already expects the format separately or if its documentation asks for a Base64 payload. The raw option omits that prefix. The editor can read supported image files up to 10 MB and uses their existing bytes without drawing them first. Animated images keep all their original bytes and frames.

Keep small assets small

Base64 represents three bytes with four text characters, plus any prefix and padding. That makes the text about a third longer than the original bytes. A tiny icon or test fixture can be convenient as embedded text. A large photo is longer to copy and harder to review. If you are free to change the source, use Resize image to reduce pixel dimensions or Compress JPEG to set a smaller file size before encoding the new copy.

Copy or download the complete result

The editor previews the first 4,096 characters when the result is long. Copy Base64 and Download TXT both use the entire result. A downloaded text file can be convenient when a clipboard is unavailable or when you want to keep a separate record. Keep the media type when your destination requires the data URL form. Decoding the result restores the original bytes, including any camera metadata that was present in the file. Use Remove EXIF data before encoding a JPEG if you want to start from a cleared copy.

Data URL or Raw Base64
Data URLIncludes the media type and the Base64 marker.
Raw Base64Contains the encoded bytes alone.

Frequently asked questions

Does Base64 reduce the size of the image?

The text is usually about one third larger than the original byte count.

Why does the preview end with an ellipsis?

The visual preview is shortened after 4,096 characters. Copy and Download TXT include all the encoded text.

Can someone turn the encoded text back into my image?

Yes. Base64 is reversible and preserves the original bytes of the image.