Image to Base64 Converter
Turn an image into Base64 and copy it as a Data URI, CSS, HTML, JavaScript, JSON or XML snippet.
- Runs in your browser — nothing uploaded
- Instant, no waiting in a queue
- Free, no watermark, no daily limits
Upload, drop or paste an image (JPG, PNG, GIF, WebP, SVG, ICO, BMP or AVIF), or load it from a URL, and the tool encodes it to Base64 instantly. Choose one of 11 output formats — plain Base64, a Data URI, a CSS background-image rule, an HTML img, favicon, link or iframe tag, a JavaScript snippet, JSON or XML — and copy or download the result. The image type is detected automatically, and the file is encoded in your browser, so it is never uploaded.
Related: Base64 Encoder / Decoder
How to Convert an Image to Base64
- 1
Add an image
Choose a local file, drag and drop it, paste it with Ctrl+V, or enter an image URL.
- 2
Pick the output format
Select plain Base64, Data URI, CSS, HTML (img, favicon, link, iframe), JavaScript, JSON or XML.
- 3
Copy or download
Click Copy to put the result on your clipboard, or Download to save it as a file.
Why use ToolzBank Image to Base64?
- 11 ready-to-paste output formats
- Data URI with the image type detected automatically
- JPG, PNG, GIF, WebP, SVG, ICO, BMP and AVIF
- Upload, drag and drop, paste (Ctrl+V) or image URL
- Shows dimensions, file size and Base64 size
- Encoded in your browser — images never uploaded
Frequently asked questions
How do I convert an image to Base64?
What is a Base64 Data URI?
Why is the Base64 bigger than my image?
Is my image uploaded to a server?
Why can’t an image URL be loaded?
More free image tools
Compress Image
Shrink JPG, PNG or WebP with a quality slider
Resize Image
Exact pixels or social media sizes
Crop Image
Free crop or 1:1, 4:3, 16:9 and 3:2
Rotate & Flip Image
Rotate, mirror or skew a photo
Photo Filters & Adjustments
Filters, brightness, contrast, blur and sharpen
Enhance Photo
Auto enhance, denoise and red-eye fix
Add Text & Frames to Image
Captions, text and photo frames
Image to SVG
Trace a logo or icon into a vector
Compress Image to KB
Hit an exact file size like 50 KB or 200 KB
Bulk Image Resizer
Resize & compress many images at once
Color Palette Extractor
Pull dominant colors from any image
Image Converter (WebP, AVIF)
Convert to WebP, AVIF, JPEG or PNG and shrink files
AI Background Remover
Transparent or white background with AI
Passport Photo Maker
2x2 in, 35x45 mm & print sheets
AI Image Upscaler
Enlarge images 2x or 4x with AI
Magic Eraser
Remove objects from photos with AI
From Our Blog
Image to Base64: When to Embed Images in HTML, CSS or Email
Convert an image to a Base64 data URI for HTML, CSS or JSON, and learn when embedding saves a request and when it just makes pages and emails heavier.
How to Convert Images to WebP for Faster Websites
WebP is the modern image format that websites should be using. It is smaller and sharper than JPG and PNG. Here is how to convert and why it matters.
