Image to Base64
Turn a small image file into a Base64 string or a complete data URL. Encoding preserves the original bytes and runs on your device.
Your selected images and pasted text stay in this browser tab. No upload, account or paid AI call.
Choose the output your destination expects
A raw Base64 string contains the encoded bytes without a prefix. A data URL adds the detected image MIME type and the base64 marker. These are different text outputs: use the complete data URL where a supported image URL is expected, and raw Base64 only when the receiving API or field asks for it. This tool does not submit either output to another service.
The encoder reads the file bytes, checks the PNG/JPEG/WebP header and verifies that the browser can decode the image. It uses the detected type rather than trusting the filename or declared MIME. It does not resize or re-encode the picture. Decoding the raw Base64 therefore recovers the original file, including its metadata.
Encoding makes text, not a smaller or safer image
Standard Base64 uses four characters for each group of up to three input bytes. The raw length is 4 × ceil(bytes / 3); the data URL adds its prefix. This is an encoding overhead, not compression. Compress an image first when small output matters, and use normal image hosting when embedding a long string would make a page difficult to maintain.
This version accepts PNG, JPG/JPEG and static WebP up to 2 MiB, 16 megapixels and 8192 pixels per side. It rejects SVG, GIF, HEIC, animated and invalid images. All processing, copy and TXT creation happen locally without upload or storage. Original metadata is preserved by the encoding, not removed. Changing files clears old output; changing output mode changes both copy and download.
How to use it
- Choose a small image — Use PNG, JPG or static WebP within the 2 MiB limit, or load the sample.
- Create the encoding — Press Encode image and choose a complete data URL or raw Base64.
- Copy or download — Review the preview and save the selected text output.
Frequently asked questions
Is Base64 a form of image compression?
No. Base64 represents binary bytes as text and normally increases the size by roughly one third, before a data URL prefix. Use Image Compressor for a smaller image.
Does it remove EXIF or other metadata?
No. The original bytes are encoded unchanged, so embedded metadata remains. Encoding is not a privacy-cleaning or encryption step.
Can I paste a remote image URL?
This version accepts local files and its built-in sample. It does not fetch remote image URLs or decode pasted Base64.
Why are SVG and animated files unsupported?
This version deliberately uses the site’s validated static PNG/JPEG/WebP workflow. It does not parse SVG documents, flatten animations or claim support for other formats.