Select an image intended for embedding
Encode a tiny logo as a data URL, then preview the decoded image to verify MIME type.
Encode an image to Base64 or decode a Base64 image without switching tools.
Base64 embeds binary content into text, increasing its size compared with the original bytes.

Encode a tiny logo as a data URL, then preview the decoded image to verify MIME type.
Encode an image as a data URL or decode an existing one.
Check MIME type and data URL size before embedding.
Encode a tiny logo as a data URL, then preview the decoded image to verify MIME type.
A small icon may be convenient as a data URL in a prototype, while a multi-megabyte photograph can make HTML or CSS unnecessarily large. Base64 usually adds roughly one-third in text length to the original data.
Use the real tool above to verify the result. The example illustrates the workflow, not a guaranteed outcome.
A small icon may be convenient as a data URL in a prototype, while a multi-megabyte photograph can make HTML or CSS unnecessarily large. Base64 usually adds roughly one-third in text length to the original data.
A data URL includes a MIME type as well as encoded bytes. Avoid printing an entire private image payload into logs or analytics.
Convert an image into a data URL for a demo. Decode a small embedded PNG data URL and confirm the resulting file really opens as an image.
Large Base64 strings can bloat documents.
Open Base64 Image mode →
Base64 embeds binary content into text, increasing its size compared with the original bytes.
Base64 embeds binary content into text, increasing its size compared with the original bytes.
Encode a tiny logo as a data URL, then preview the decoded image to verify MIME type.
Encode an image as a data URL or decode an existing one.
A small icon may be convenient as a data URL in a prototype, while a multi-megabyte photograph can make HTML or CSS unnecessarily large. Base64 usually adds roughly one-third in text length to the original data.
Base64 converts binary bytes into text characters that can travel inside a text-only field. For an image, a data URL commonly begins with data:image/png;base64, followed by encoded content. That prefix declares the media type; it is not part of the image's pixel data. A 120×80 PNG converted to Base64 can be reconstructed into a PNG file by decoding the payload, assuming the input was preserved correctly. The text becomes longer than the original binary because Base64 uses a representation with roughly one-third overhead before any additional metadata.
Do not mistake a Base64 string for a compressed format. Encoding a 4 MB image may produce more than 5 MB of text; it does not reduce download weight. For websites, embedding a large data URL directly into HTML or CSS can make source files harder to cache independently and can increase memory use. Small icons may sometimes be embedded, but larger photographs are generally better served as normal assets with appropriate compression. Check the destination platform's maximum field length before pasting a very long encoded result.
A data URL that claims image/jpeg does not magically turn PNG bytes into JPEG. The actual file bytes must match the indicated format for reliable use. If decoding succeeds but the image viewer rejects the output, inspect whether the input contained an extra prefix, missing characters, copied line breaks or a nonmatching MIME declaration. Preserve the full string when copying. If the original image contains transparency, decoding a genuine PNG should retain that transparency; an inaccurate JPEG declaration may confuse consumers.
A useful round-trip test is to select a small sample image, encode it, decode the result, reopen the downloaded image and compare dimensions. For byte-level verification, a matching cryptographic checksum proves the encoded/decoded bytes are identical when no format conversion occurred. If you convert the image format as a separate operation, a checksum will naturally change and visual comparison is more appropriate. Base64 is not encryption, watermark protection or a privacy shield: anyone receiving the encoded string can recover the image.
Data URLs are useful in controlled settings such as self-contained HTML examples, API fixtures or testing an image-upload parser. Be cautious about placing sensitive photos in logs or URLs because the encoded text still contains the complete picture. If a data URL is inserted into code, keep its quoting and escaping correct, and ensure untrusted HTML cannot execute scripts in the target context. Copy a representative beginning and ending portion only for debugging rather than posting the entire private payload in a public issue.
A 100 KB image encoded as Base64 commonly becomes roughly one-third larger as text before any HTML overhead. That means a data URL can be convenient for a tiny icon but inefficient for full-resolution photographs or long documents. The encoded string contains the image data and is not an encrypted copy. If you decode it, inspect the returned MIME type and open the resulting image to confirm the expected dimensions; a wrong MIME header can cause confusing display failures. When sharing HTML, consider whether an ordinary file reference would cache and download more efficiently than an inline image string.
Browsers can treat an inline data URL as part of the page document rather than as a separately cached file resource. For an icon repeated across many pages, a regular referenced image can be more efficient because the browser may reuse its cached bytes. Avoid pasting megabytes of Base64 into a text editor without checking the document-size impact. Treat the string as full image data for sharing and privacy purposes.
Convert an image into a data URL for a demo. Decode a small embedded PNG data URL and confirm the resulting file really opens as an image.
Usually not; the string increases page weight and can be hard to maintain.
No. Encoding preserves the source bytes' content; it cannot invent missing pixels or improve an originally blurry image.
Every three source bytes are represented by four Base64 characters, before prefixes or formatting overhead.
Not reliably. You would usually corrupt encoded bytes rather than perform a meaningful image transformation.