Convert an Image to Base64
Turn an image into Base64 text you can paste into JSON, HTML, CSS or an API request, with the size cost shown up front.
- On-device
- No sign-up
- Batch
- Free, no watermark
Drop images on the plate
or paste with Ctrl/⌘ V
Processed on this device
How it works
- 01Drop, choose or paste one or more images.
- 02Compare the original and encoded sizes for each file.
- 03Copy the raw Base64 string or the full data URI.
Why use this tool
Raw string and data URI
Get plain Base64 for APIs and config files, or a complete data URI with the correct MIME type prefix for HTML and CSS.
Honest size figures
The original size and the encoded size are shown side by side, so you can see the roughly 33% overhead before committing.
Encoded in your browser
Images are converted to text locally, which matters when the file is an unreleased design or a private document scan.
Supported formats
Use cases
Sending images to an API
Many JSON APIs expect image uploads as a Base64 field. Encode the file and paste the string straight into your request body or test fixture.
Small icons in HTML email
Embed a tiny logo or icon so it travels with the message. Note that some email clients block inline data images, so test before sending.
Self-contained test files
Put a small sample image directly into a unit test or a single-file demo, so it runs without separate asset files.
Technical details
Base64 represents every 3 bytes of binary data as 4 text characters, so the encoded output is about 33% larger than the image file. A 30 KB PNG becomes roughly 40 KB of text. Gzip or Brotli compression on a server recovers only part of that, because the image data is already compressed. The encoding doesn’t change the image itself: decoding the string gives back the exact original bytes, with the same format, dimensions and metadata.
Inlining is a poor fit for large images. An inlined image can’t be cached separately, so it is downloaded again every time the HTML or CSS containing it changes, and it delays rendering of the page that carries it. Keep Base64 for small icons, tiny placeholders and API payloads. For CSS and HTML snippets, the Data URI Generator produces ready-to-paste code.
Your files stay with you
This tool runs entirely inside your browser using Web Workers and WebAssembly. Your images are never uploaded, never stored on a server and never used to train AI. Close the tab and they’re gone. Learn more
Frequently asked questions
Why is the Base64 version bigger than my image?
Base64 uses only 64 safe text characters, so it needs 4 characters to carry every 3 bytes of data. That makes the output about 33% larger than the original file, plus a short prefix for a data URI. The size cost is the price of turning binary data into plain text.
What is the difference between raw Base64 and a data URI?
Raw Base64 is just the encoded characters. A data URI adds a prefix such as data:image/png;base64, which tells a browser what the data is, so it can be used anywhere a URL is expected, like an img src or a CSS background. APIs usually want the raw string.
When should I not convert images to Base64?
Avoid it for photos and any image over a few kilobytes. The text is a third larger, it can’t be cached on its own, and it bloats the HTML, CSS or JavaScript file that contains it. Linking to a normal image file is faster for almost everything except tiny icons and API payloads.
Does encoding change the image quality?
No. Base64 is an encoding, not compression. Decoding the string returns exactly the same bytes as the original file, so the quality, format and dimensions are unchanged. If you want a smaller result, compress or resize the image before you encode it.
Related tools
Base64 to Image
Paste a Base64 string or a full data URI and see the image it contains, then save it as a normal file with…
DEVData URI Generator
Get a ready-to-paste code snippet that embeds an image directly in your CSS, HTML or Markdown, with no…
WEBFavicon Generator
Upload one logo or icon and get every file a modern website needs for browser tabs, bookmarks and home…
WEBICO Generator
Make a custom .ico file containing exactly the icon sizes you need, for Windows apps, shortcuts and…