Base64 Image Converter
Turn an image into a Base64 string for embedding in HTML, CSS or JSON — or paste a Base64 string to preview and download the image it represents.
Click to choose or drag & drop an image here
JPG, PNG, GIF, WebP, SVG supported
What Base64 is used for
Base64 turns binary image data into plain text, so it can be embedded directly inside HTML, CSS, or JSON instead of linking to a separate file. This is useful for small icons and logos where you want to avoid an extra HTTP request, for embedding images in emails (since many email clients block external image loading by default), or for storing image data inside a data URI in code.
All conversion here happens locally in your browser using the FileReader and Canvas APIs — your image or Base64 string is never sent to a server.
How to convert an image to Base64
- Switch to the "Image → Base64" tab.
- Upload your image by clicking the drop area or dragging a file in.
- The Base64 string appears automatically in the text box — click "Copy to clipboard" to use it in your code.
How to convert Base64 back to an image
- Switch to the "Base64 → Image" tab.
- Paste your Base64 string (a raw string or a full data URI both work).
- Click "Preview image" to see the decoded result, then download it as a file.
FAQ
Does converting to Base64 make the file bigger?
Yes — Base64 encoding increases size by roughly 33%, since it represents binary data as text. This is expected and normal; it's a trade-off for being able to embed the image as text.
Is my image uploaded to a server?
No. Both directions of conversion happen entirely in your browser.
Can I convert SVG files too?
Yes, SVG works in both directions since it's supported as a standard image MIME type.