🔒 Runs in your browser — nothing is uploaded✓ Free, no signup
Image to Base64 Converter
Drop, choose or paste an image to get its Base64 data URI — ready to use in CSS, HTML, JSON or Markdown. Your image never leaves your device.
The image is read on your device. It is never uploaded.
Base64 output
Choose an image to see its Base64 code.
When should you use the Image to Base64?
- Embedding a small icon or logo directly in CSS
- Adding images to HTML emails without hosting them
- Putting an image into JSON or an API request body
How to use the Image to Base64
- 1
Add an image
Drag it onto the box, click to choose a file, or paste with Ctrl/⌘ V.
- 2
Check the size
See the original size and the Base64 size. Images over 100 KB get a warning.
- 3
Pick a format
Choose the data URI, plain Base64, a CSS rule, an <img> tag or Markdown.
- 4
Copy
Click Copy next to the format you need.
Examples
A small PNG icon
Input
icon.png (1.2 KB, 32 × 32)
Output
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA…
background-image: url("data:image/png;base64,…");Common errors and how to fix them
The Base64 string is enormous- Base64 adds about 33% to the file size. Compress or resize the image first with the Image Compressor, or serve large images as normal files.
Pasting doesn't work- Some browsers only paste images copied as images (not as files from a folder). Use drag and drop or the file picker instead.
More from Image Tools
Free tools that run in your browser — no signup, nothing uploaded.
Crop Image Online
Crop images exactly as selected with fixed aspect ratios. No upload, no resize, no quality loss.
Compress Image Online
Compress JPG, PNG & WebP images directly in your browser. No upload, no tracking, instant download.
Image Resizer
Resize images to exact pixels or a percentage, keeping the aspect ratio.
Image Converter (PNG, JPG, WebP)
Convert images between PNG, JPG and WebP in your browser.
Base64 to Image Decoder
Decode Base64 or a data URI back into a viewable, downloadable image.
JSON Auto-Fixer & Formatter
Repair, validate, and beautify broken JSON (missing quotes, trailing commas).
JSON Compare & Diff Tool
Find the difference between two JSON objects visually and quickly.
JWT Decoder
Decode and inspect JSON Web Tokens (JWT) Header and Payload.
Epoch converter online
Convert UNIX timestamps to human-readable dates and back instantly.
Image to Base64 FAQ
Drop an image on the box, click to choose a file, or paste an image with Ctrl/⌘ V. The Base64 data URI appears instantly, ready to copy as plain Base64, CSS, an HTML <img> tag or Markdown.
A data URI embeds a file directly in your code, like data:image/png;base64,iVBORw0…. Browsers display it like a normal image URL, without a separate download.
For small images such as icons, tiny logos or placeholders — usually under a few kilobytes — in CSS, HTML emails or JSON. They save an extra request but can't be cached separately.
Base64 represents every 3 bytes as 4 text characters, so the result is about 33% larger than the original image. That's why large images are better served as normal files.
Any image your browser can read, including PNG, JPG, GIF, WebP, SVG, AVIF and ICO.
No. The image is read with your browser's FileReader and converted on your device. Nothing is sent to a server.
