Image to Base64 Converter
Convert a JPG, PNG, WebP, GIF, or SVG image to a Base64 string online for free. Copy it or download as a .txt file — nothing is uploaded.
Drop your file here
or choose a file
Supports JPG, PNG, WebP, GIF, or SVG
Your files are processed locally in your browser and are not uploaded to our servers.
How to use the Image to Base64 converter
- 1
Drop a JPG, PNG, WebP, GIF, or SVG image onto the upload area, or click it to choose one.
- 2
The Base64 string (and full data URL) appears in the text area automatically — no separate "convert" step.
- 3
Click "Copy Base64" to copy it, or "Download .txt" to save it as a text file.
Common uses
- Embedding a small icon or image directly into CSS or HTML without a separate file request
- Pasting an image into a JSON payload or config file that only accepts text
- Quickly generating a data URL for testing or a code snippet
Supported formats and limitations
Accepts JPG, PNG, WebP, GIF, or SVG, up to one file at a time.
- Base64 encoding makes the text representation roughly a third larger than the original file — large images produce very long strings that aren't practical to embed everywhere.
- This is a one-way encode — this tool doesn't include a Base64-to-image decoder.
- One file at a time, up to 10 MB.
Frequently asked questions
The Base64 string is just the encoded data. The data URL adds a `data:image/png;base64,` (or similar) prefix in front of it, which is what you'd paste directly into an `src` or `url()` in code.
Base64 encoding always increases size by roughly a third compared to the original binary file — a 300 KB image becomes a Base64 string of around 400,000 characters. This is expected, not an error.
No. The file is read and encoded entirely in your browser — nothing is sent to a server at any point.
Not with this tool — it only encodes an image into Base64, not the reverse.
SVG files are just XML text, so they encode to Base64 the same as any other file here — this works for any valid SVG regardless of its visual complexity.