Image to Base64 Converter — Encode & Decode Locally
Convert images to Base64/data URLs and back in your browser—no upload. Steps: encode a file to copy a data URL, or paste Base64 to preview and download. Example: sample PNG → data:image/png;base64,… ready to paste into HTML — files stay on your device.
How it works
Use Encode to read a file as a data URL, or Decode to paste Base64 and download an image.
Rules
Encode uses readAsDataURL. Decode accepts data:image… or raw Base64 (default MIME image/png).
- Optional strip of the data: prefix for raw Base64.
- Invalid strings show an error.
- Large strings may use more memory.
- Nothing is uploaded.
Example
Sample encodes a small PNG and shows the data URL in the output box.
Good fits
- Embed small icons in HTML/CSS.
- Debug email or markdown image payloads.
- Recover a preview from a Base64 dump.
Frequently asked questions
Uploaded?
No.
Data URL vs raw?
Data URLs include a MIME prefix; raw is only the Base64 body.
Huge files?
Possible but memory-heavy—prefer compress first.
Which MIME on decode?
Taken from the data URL, or image/png for raw.
Animated GIF?
Encoded as a file blob; animation is not edited here.
Questions or feedback
Something unclear, broken, or missing? Draft a message below — we read every note about these tools.