Image Converter
Change images between JPG, PNG, and WebP in your browser. Pick the format and download the result.
Open tool →Upload an image and get its base64 string in seconds. Copy the full data URI or the plain base64, with the file size and format shown.
Last updated: 17 November 2026.
Drop an image here, or click to choose one
JPG, PNG, WebP, GIF, SVG, and more. Your file never leaves your browser.The image is read with the FileReader API and turned into text on your device. Nothing is uploaded, sent, or stored.
Base64 is a way to write binary data, such as an image, as plain text. It uses 64 safe characters, the letters A to Z, the digits 0 to 9, plus and slash, with an equals sign for padding at the end. An image file is a stream of bytes that cannot sit inside a text file or a line of code, but its base64 form is ordinary text, so it can be pasted into HTML, CSS, or a JSON file without breaking anything. The text is longer than the original file, but it travels anywhere text can go.
A base64 image is usually wrapped in a data URI, which looks like data:image/png;base64, followed by the long string. The first part tells the browser what kind of file it is and that base64 follows, and the rest is the image itself. Put that whole line into an img tag as the source, and the browser draws the image without loading a separate file. That is why developers use base64 for small icons, logos, and images that must live inside a single file.
The most common reason is to embed a small image directly in a page or a style sheet. A tiny logo or icon as a separate file needs an extra request to the server, which takes time and can fail. Embedded as base64, the image loads with the page itself, so there is nothing extra to fetch and nothing to break if the file moves. This is handy for email templates, single file HTML pages, and small graphics that appear on every page of a site.
Base64 is also useful when an image has to pass through a system that only accepts text. Some APIs, data files, and code generators cannot take a binary upload, but they can take a long text string. Turning the image into base64 first lets it ride along in a JSON object, a database field, or a configuration file. It is the same trick behind image placeholders in code samples and test data, where a real image needs to exist inside a block of text.
Start by choosing an image. Click the Choose an image button, or drag the file onto the drop zone. The tool accepts JPG, PNG, WebP, GIF, SVG, and other common image formats. As soon as the file is read, a preview appears along with the file name, the format, the size in kilobytes or megabytes, and the length of the base64 string. The first 240 characters show in the preview box, and the full string sits in the box below it.
The checkbox above the output controls the data URI prefix. With it on, the string starts with data:image/png;base64, and is ready to paste into an img tag or a CSS background. With it off, you get the plain base64 characters only, which is what most APIs and data fields expect. Press Copy full base64 to copy the whole string in the form you chose, or Download .txt to save it as a text file. Clear removes the image and the output so you can start over. The image is read on your device and never leaves your browser.
Base64 helps most with small images. A logo under 10 kilobytes, a favicon, or a tiny icon becomes a short string that is easy to paste and costs almost nothing extra. It also helps when a page must work as a single file, such as an email, a saved web page, or an offline document, because the image cannot get separated from the text around it. In those cases the convenience is worth the small size increase.
It hurts with large images. A base64 string is about a third bigger than the original file, so a 1 megabyte photo becomes about 1.4 megabytes of text. That text has to download with the page, it cannot be cached separately like a normal image file, and it makes the HTML file harder to read and edit. For photos and large graphics, keep the image as a file and link to it instead. If a photo is too big to embed, the image compressor can shrink it first, and the image converter can change it to a smaller format before you convert it.
The size shown is the size of the file you uploaded, and the base64 length is the size of the text that comes out. The text is always bigger, by about 33 percent, because base64 packs three bytes of image data into four text characters. A PNG with large flat areas may still come out smaller than a noisy JPG of the same picture, because the starting file is smaller, so the format matters as much as the dimensions.
Most formats work the same way here, and the data URI keeps the original format, so a PNG stays a PNG and a JPG stays a JPG when the browser draws it. SVG files are text already, so they also convert cleanly. If you need the smallest possible result, convert the image to WebP first, then turn that file into base64.
A base64 image is an image file written as plain text. The binary data is turned into a string of safe characters, usually wrapped in a data URI such as data:image/png;base64, so it can sit inside HTML, CSS, or JSON.
Base64 packs three bytes of image data into four text characters, which adds about 33 percent to the size. A 30 kilobyte image becomes a string of about 40 kilobytes, and the gap grows with larger files.
JPG, PNG, WebP, GIF, and SVG all work, along with other common image formats. The data URI keeps the original format, so a PNG stays a PNG when the browser draws it.
Yes. With the data URI prefix on, paste the string as the src of an img tag, or as a url() value in CSS. With the prefix off, you get the plain base64 characters, which is what most APIs and data fields expect.
No. The image is read on your device with the FileReader API and turned into text in your browser. It is never uploaded, never sent to a server, and never stored. You can close the page and nothing remains.