Image to Base64
Convert a JPG, PNG, or WebP image into a Base64-encoded string or data URI, directly in your browser — for embedding in CSS, HTML, or JSON.
Drop your image here or choose a file. Accepts JPEG, PNG, and WebP.
You can also paste an image with Ctrl+V / Cmd+V.
Your images are processed directly in your browser — they are never uploaded to a server.
Image
Original size
Base64 size
About Image to Base64
Convert a JPG, PNG, or WebP image into a Base64-encoded string directly in your browser — useful for embedding a small image straight into CSS (background-image: url(...)), HTML (<img src="...">), or JSON without a separate file request.
Base64 encoding turns binary data into text, which adds roughly 33% to the size — worth keeping in mind for larger images. Nothing is uploaded; the encoding happens entirely on your device.
Frequently asked questions
Do my images get uploaded anywhere?+
No — encoding happens entirely in your browser using the FileReader API already built into it. Your image is never sent to a server.
What’s the difference between the two output options?+
With the prefix included, you get a full data URI (`data:image/png;base64,...`) ready to drop straight into an `<img src>`, a CSS `background-image: url(...)`, or JSON. Without it, you get just the raw Base64 payload, useful when your own code will add the appropriate wrapper.
Why is the Base64 output bigger than my original file?+
Base64 encodes binary data as text using only 64 printable characters, which takes roughly 4 bytes of text for every 3 bytes of binary data — about a 33% size increase. This is expected and unavoidable for any Base64 encoding, not specific to this tool.
Is this tool free?+
Yes, completely free with no sign-up.
Related tools
Developer
Base64 Encoder/Decoder
Encode text to Base64 or decode Base64 back to text, instantly and entirely in your browser.
Image
Image Compressor
Compress JPG, PNG, and WebP images directly in your browser. Reduce image file size while keeping quality under your control.
Image
Image Resizer
Resize JPG, PNG, and WebP images directly in your browser, by exact dimensions or by percentage, with the aspect ratio locked or free.
Image
Image Converter
Convert images between JPG, PNG, and WebP directly in your browser — in either direction, with quality control and transparency handled correctly.
Image
Image Cropper
Crop JPG, PNG, and WebP images directly in your browser — drag to select the exact area to keep, or enter precise pixel values, with optional aspect ratio locking.
Image
Image Rotator
Rotate JPG, PNG, and WebP images by 90°, 180°, or 270° directly in your browser — preview the turn instantly, then download the result.
Image
Image Flipper
Mirror JPG, PNG, and WebP images horizontally, vertically, or both, directly in your browser — preview instantly, then download the result.
Image
Image Metadata / EXIF Viewer
Read a photo's EXIF metadata — camera make and model, exposure settings, date taken, and GPS location if present — directly in your browser.
Image
Base64 to Image
Paste a Base64 string or data URI and convert it back into a downloadable JPG, PNG, or WebP file, directly in your browser.