Image to Base64 Converter
PNG, JPEG, GIF, WebP, BMP, SVG · stays in this browser
Text encoderImage
Drop an image here
PNG, JPEG, GIF, WebP, BMP, or SVG · max 8 MB
Preview
Drop an image or choose a file to encode.
Image to Base64 converter
Looking for an image to Base64 converter, a Base64 to image decoder, or a data URI generator? Toolshelf turns pictures into Base64 and Base64 back into pictures in your browser — no signup and no uploads.
Drop a PNG, JPEG, GIF, WebP, BMP, or SVG to copy a data URI, raw Base64, CSS url(), or HTML <img> snippet. Paste a string to preview and download the image. For UTF-8 text and Base64URL, use the Base64 Encoder & Decoder.
What you can do with this converter
- Convert PNG, JPEG, GIF, WebP, BMP, or SVG to Base64 in the browser
- Paste a data URI or raw Base64 to preview the image
- Copy a data URI, raw Base64, CSS url(), or HTML <img> snippet
- Download the encoded text or the decoded image file
- Checkerboard preview so transparent PNGs stay visible
- Clear errors for invalid Base64, HEIC, and oversize files
- Draft stays on this device — nothing is uploaded
- Works on phones, tablets, and desktops
Image to Base64 vs text Base64
Encoding a photo is not the same job as encoding a Unicode string. Image conversion must preserve binary bytes, attach a MIME type, and show a preview. Text encoding must round-trip Hindi, emoji, and Base64URL. Putting both on one page would bury one of those paths, so Toolshelf keeps them as two tools that link to each other.
How a data URI works
A data URI is a URL that carries the file itself: data:<mime>;base64,<payload>. Browsers can paint that string as an image without a second network request. That is useful for tiny icons and email HTML. Large photos make HTML or CSS huge — compress first with the Image Compressor if you only need a small embed.
Common uses
Embed an icon in CSS or HTML
Turn a small PNG or SVG into a data URI and paste it into a stylesheet, email template, or static HTML file without hosting the asset.
Inspect a data URI from DevTools
Copy a data:image/…;base64 string from CSS, JSON, or a network payload, paste it here, and see the actual picture.
Move a screenshot without uploading
Encode a screenshot as Base64 on your device when you cannot attach the file but can paste text into a ticket or chat.
Recover an image from a dump
Decode Base64 pulled from a log, markdown file, or API fixture and download it as PNG, JPEG, or SVG with the correct extension.
How to convert an image to Base64
- 1Keep Image → Base64 selected. Drop a file or click Choose image.
- 2Pick Data URI, Raw, CSS, or HTML, then copy. The preview shows the same pixels on a checkerboard so transparency is obvious.
- 3To reverse the job, open Base64 → Image, paste the string, and download the image file.
Limits
- Files are capped at 8 MB so a huge paste cannot freeze the tab.
- Base64 input is capped at 12 million characters. Over-limit input is rejected with a message, not silently cut.
- HEIC, PDF, and video are not images here. Convert or export to PNG or JPEG first.
- SVG is previewed as an image, not executed as HTML. Scripts inside SVG should not run in the preview.
Frequently asked questions
- What is an image to Base64 converter?
- It reads image bytes and writes them as ASCII Base64, usually as a data URI such as data:image/png;base64,…. You can paste that string into HTML, CSS, JSON, or email. This page also reverses the step: paste Base64 and preview or download the image.
- What is the difference between raw Base64 and a data URI?
- Raw Base64 is only the A–Z a–z 0–9 + / = payload. A data URI adds a prefix such as data:image/jpeg;base64, so a browser knows the MIME type. CSS and HTML usually need the data URI. APIs sometimes want the raw payload.
- Which image formats can I convert?
- PNG, JPEG, GIF, WebP, BMP, and SVG, up to 8 MB. HEIC from iPhones is rejected with a message to export PNG or JPEG first. The file type is detected from magic bytes, not only the extension.
- Does this tool upload my image?
- No. Toolshelf converts the image in your browser. Bytes are not sent to a server. A draft can stay in this browser (IndexedDB) so refresh does not wipe the last file. Clear removes it.
- Can I decode Base64 back to an image?
- Yes. Switch to Base64 → Image, paste a data URI or raw Base64, and the preview updates. Download saves a real image file with the matching extension (.png, .jpg, .gif, .webp, .bmp, or .svg).
- Why is my Base64 string so long?
- Base64 is about 33% larger than the original file. An 8 MB image becomes roughly 11 million characters. That is expected. If the tab feels slow, use a smaller image or compress it first.
- Is this the same as the Base64 encoder?
- No. The Base64 encoder is for UTF-8 text and Base64URL (including Hindi and emoji). This page is for image files and data URIs. Use the text encoder if you need to encode a string, not a picture.
- Is Base64 encryption?
- No. Anyone can decode a data URI. Do not treat encoded images as secret. The conversion only changes representation so binary can travel as text.
Related tools
Continue with related browser-based tools on Toolshelf.
- Base64 Encoder & Decoder — Online Base64 encoder and decoder.
- Image Compressor — Online image compressor.
- Photo Collage Maker — Photo collage maker.
- URL Encoder & Decoder — Online URL encoder and decoder.
- JPG to PDF — JPG to PDF converter.
- PDF to JPG — PDF to JPG converter.
- JSON Formatter & Minifier — JSON formatter online: beautify, minify, and validate JSON in your browser.
- Code Formatter & Beautifier — Online code formatter and beautifier.
Ready to convert an image to Base64?
Scroll up, drop a file or paste a data URI, and copy the result. Processing stays in this browser.
Back to converterExamples
PNG to data URI
Drop a PNG. Copy the data:image/png;base64,… string into CSS or HTML.
Paste a data URI
Switch to Base64 → Image, paste the string, and download the picture with the right extension.
Limitations
- PNG, JPEG, GIF, WebP, BMP, and SVG only — HEIC is not supported.
- Files over 8 MB are rejected so the Base64 string cannot freeze the tab.
Use cases
- For Developers — Format JSON, test regex, decode JWTs, and work with timestamps.
- For Creators — Cut video, extract audio, compress images, and convert clips to GIF.
- For Designers — Pick colors, check contrast, and build palettes and gradients.
What would you like to do next?
Continue working with the next step in this workflow. Recently used tools in this set are listed first.
- Photo Collage Maker — Photo collage maker.
- Base64 Encoder & Decoder — Online Base64 encoder and decoder.
- Image Compressor — Online image compressor.
- URL Encoder & Decoder — Online URL encoder and decoder.
You may also need
Continue with related browser-based tools on Toolshelf.
- Base64 Encoder & Decoder — Online Base64 encoder and decoder.
- Image Compressor — Online image compressor.
- Photo Collage Maker — Photo collage maker.
- URL Encoder & Decoder — Online URL encoder and decoder.
- JPG to PDF — JPG to PDF converter.
- PDF to JPG — PDF to JPG converter.
- JSON Formatter & Minifier — JSON formatter online: beautify, minify, and validate JSON in your browser.
- Code Formatter & Beautifier — Online code formatter and beautifier.
Next steps
Related workflows on Toolshelf. These are curated paths, not usage rankings.
- Image workflow — Compress images, convert them to Base64, make a collage, or export PDF pages as JPEGs.