Base64 Encoder/Decoder
Convert images to Base64 strings and back again—no coding required. Simply upload or paste, then let our tool handle the rest.
How It Works
- 1Encode Image → Base64
- Click “Click to upload image” or drag-and-drop your file into the left panel.
- Once uploaded, your image auto-converts and displays as a Base64 string below.
- Copy the entire string (including the
data:image/png;base64,prefix) for embedding.
- 2Decode Base64 → Image
- Paste your Base64 string into the right-panel textarea.
- Click “Decode Image.” The image renders immediately below.
- To save, click “Download Image.”
Image to Base64
Click to upload image
Base64 to Image
Why Convert an Image to Base64?
Base64 turns binary image data into plain text, so it can be embedded directly inside HTML, CSS, or JSON instead of being linked as a separate file. It isn't compression or encryption — it's just a text-safe representation of the same bytes.
Encode (Image → Base64)
Use when you need to inline a small icon or logo directly into CSS (background-image: url(data:...)) or HTML, avoiding an extra HTTP request.
Decode (Base64 → Image)
Use when an API response, JSON payload, or email attachment contains an image as a Base64 string and you need to preview or save it as a real file.
Common Ways People Use This Tool
Inline CSS/HTML Icons
Embed small logos or icons directly in a stylesheet so they load with zero extra network requests.
Debugging API Responses
Paste an image field from a JSON API response here to see what it actually looks like.
Recovering Email Attachments
Decode an inline Base64 image from raw email/HTML source and save it as a normal file.
Frequently Asked Questions
Is Base64 the same as image compression or encryption?
No. Base64 only re-encodes the same bytes as text — it does not compress the image or add any security.
Do my images get uploaded to a server?
No. Encoding and decoding happen locally in your browser using JavaScript. Your image is never sent anywhere.
Why is my Base64 string so much longer than the original file?
Base64 encoding increases file size by roughly 33%, since it represents binary data using only text-safe characters.
Why won’t my pasted Base64 string decode?
The decoder expects a full data URL starting with data:image/ and containing ;base64,. If you only have the raw string, add that prefix first.
What image formats are supported?
You can encode any common image format, including PNG, JPG, and WebP, and decode any valid Base64 image data URL back to a file.
