Image to Base64
Encode an image as Base64 text (a data URI) that you can paste straight into HTML, CSS, JSON or an email template, or decode Base64 text back into an image file.
- Runs in your browser
- No sign-up
- Nothing uploaded
Your file
How to use the Image to Base64
- Keep "Image to Base64" and add an image (PNG, JPG, WebP, GIF, BMP, AVIF, SVG or ICO).
- Press "Encode". The data URI appears with its size.
- Copy it as a data URI, an HTML <img> tag or a CSS background, or download it as a .txt file.
- To go the other way, choose "Base64 to image", paste the text and press "Decode".
Base64 makes a file about a third larger, and the browser cannot cache it separately, so it suits small images: icons, logos, tiny backgrounds and email signatures. Larger images are better linked as files.
The image is encoded exactly as it is: the bytes are not changed or recompressed.
Formats and limits
- Opens
- PNG, JPG, WebP, GIF, BMP, AVIF, SVG and ICO
- Creates
- A data URI, HTML and CSS snippets, or an image file
- File size
- Up to 5 MB
- Processing
- On your device, in your browser
Good to know
- Images up to 5 MB; beyond that a data URI is impractical to paste anywhere.
- Base64 to image accepts a data URI or plain Base64 text of a supported image format.
Your files are processed on your own device. They are not uploaded to File Perks or anyone else. Read the Privacy Policy.
Frequently asked questions
Why is the Base64 text bigger than my image?
Base64 writes every 3 bytes as 4 letters, so the text is about 33% larger than the file.
When should I use a data URI?
For small images that must travel inside one file: an HTML email, a single-file page, a CSS sprite or a JSON payload. For normal web pages, a separate image file loads and caches better.
Is my image uploaded?
No. Encoding and decoding happen in your browser.