1Tools

Load an image from a URL, click Choose file to upload, or click the image area and drag a file onto it. You can also paste an image from the clipboard.

Image input

Base64 output

Base64 to Image
Output
Size comparison appears after convert.

Image & Media

Image to Base64

Convert an image to Base64 online in your browser — drop a PNG, JPG, SVG, or WebP and get a paste-ready string instantly. Choose the output you actually need: a complete Data URL for an HTML img src, a raw Base64 string for an API field, or a ready-made HTML or CSS snippet. You also see the exact size difference, because Base64 always makes an image about a third bigger. Nothing is uploaded to a server.

What you can do

  • Drop and convert, no size limit

    Drag a PNG, JPG, SVG, GIF, WebP, or BMP onto the page — or click to choose a file. There is no artificial file-size cap; if your browser can read it, this tool can encode it.

  • Four paste-ready output shapes

    Switch between a complete Data URL, a raw Base64 string, an HTML <img> tag, or a CSS background-image snippet. Default is Data URL so most users can paste with zero extra steps.

  • Exact size comparison

    See the original byte count, the Base64 length, and the exact inflation percentage after encoding — measured from your file, not a rounded guess.

  • Clear format and MIME labels

    The tool keeps your original format and shows the MIME type and dimensions. Nothing is converted, compressed, or re-encoded along the way.

  • Runs entirely in your browser

    Encoding never leaves your device. There is no upload endpoint and no server-side copy of the image.

How to use

  1. 01

    Drop an image onto the left panel, click to choose a file, or paste an image from the clipboard.

  2. 02

    Pick the output shape you need — Data URL, raw Base64, HTML <img>, or CSS — then click Convert if the result is not already filled in.

  3. 03

    Copy the result or download a .txt file, and paste it into HTML, CSS, an API field, or email template work.

About converting an image to Base64

  • What image to Base64 means

    An image to Base64 conversion — also searched as base64 encode image — turns a picture file into text so it can sit inside HTML, CSS, JSON, or an API payload without a separate image request. The usual finished form is a Data URL such as data:image/png;base64,iVBORw0KGgo… — that single string is enough for an HTML img tag or a CSS background.

  • The four parts of a Data URL

    A Data URL has four parts. It starts with data:, then a MIME type (for example image/png or image/jpeg), then an optional ;base64 marker, then a comma and the payload. Phrases like data image jpeg base64 and image in base64 format are really asking about this structure. When the ;base64 marker is present, the payload is Base64; without it the payload is URL-encoded text instead.

  • Four paste-ready output shapes

    This converter gives four output shapes because searchers rarely want the same thing. A complete Data URL is ready for an HTML img src or a CSS url(). A raw Base64 string fits API fields and database columns that store only the payload. An HTML img snippet is a finished tag you can paste into markup. A CSS background-image snippet is ready for a stylesheet. Defaulting to Data URL covers the most common convert image to base64 online intent with zero extra clicks.

  • Why Base64 makes images bigger

    Base64 always makes the image bigger. Every three bytes become four characters, so encoded length is about 4/3 of the original — roughly a +33% increase, or ceil(bytes/3)*4 characters for the payload. The size bar on this page shows the original bytes, the Base64 length, and the exact percentage for the file you just encoded.

  • When inlining is a good trade-off

    Inline Base64 is a trade-off, not a default for every asset. Small icons and tiny diagrams (a few kilobytes) fit well inside HTML or CSS. Large photos bloat the document, defeat separate caching of the image file, and slow first paint — prefer a normal file path for those.

  • Three ways to use Base64 images in HTML

    In HTML you typically use a Base64 image three ways: an img src="data:image/png;base64,…" attribute, a CSS background-image: url("data:…"), or a CSS url() inside another rule. This page can emit the first two as ready-made snippets so you do not assemble the string by hand.

  • SVG is different from bitmaps

    SVG is a special case. An SVG file is XML text, not a bitmap. Encoding it as Base64 does not make it more readable — it only helps when you must embed the graphic where quotes or newlines would break a string. For many pages, inlining the SVG source directly is better than Base64 because the markup stays searchable, styleable, and scriptable. When you do encode SVG, use the correct MIME (image/svg+xml) in the Data URL, optionally with charset=utf-8 for non-Base64 forms.

  • MIME type must match the bytes

    MIME type matters. A Data URL that says image/jpeg while the bytes are PNG can fail to render or be handled incorrectly. This tool keeps the original format and labels the MIME it used, so png to base64, jpg to base64, and svg to base64 stay honest about what you dropped in.

  • Base64 is encoding, not encryption

    Base64 is encoding, not encryption. There is no key. Anyone who receives the string can decode it back into the original bytes. Do not use Base64 to hide sensitive pictures — use it for transport, offline embeds, and local debugging only.

  • When not to store images as Base64

    When you should not store an image as Base64: large photos, anything that benefits from HTTP caching, and modern formats you would rather serve as files (WebP, AVIF). Keep Base64 for small assets, one-off embeds, and debugging. For the reverse direction — turning a Base64 string or Data URL back into a previewable file — use Base64 to Image on this site. For general text or file Base64 encode and decode (not image-focused), use the Base64 Encoder & Decoder.

Private, exact, and free

  • 100% in your browser

    Your image is read and encoded on your machine. It is never uploaded, and no copy is stored on a server.

  • No sign-up, no size limit

    Open the page and drop in a file. There is no account, no login, and no artificial cap on how large the image can be.

  • The real size difference

    You see the original byte count, the Base64 length, and the exact percentage the encoding adds, not a rounded guess.

  • Your file, your format

    The output keeps the original format and MIME type. Nothing is converted, compressed, or re-encoded along the way.

FAQ

Base64 to ImageBase64 Encoder & DecoderImage Metadata ViewerAll toolsBack to home

Missing a format or feature?

Missing something this page does not cover? Tell us — batch conversion, AVIF and HEIC support, and related image tools are the requests we are reading most.

Send feedback