A photograph converted into a Base64 text representation.

ONELESS · IMAGE LIGHT

Image to Base64

A small image sometimes needs to travel inside a text field, a stylesheet, or a self-contained example. Image to Base64 converts the file you choose into a string without redrawing the picture. You can see the image beside its code, choose raw Base64 or a complete data URL, and copy or save exactly the form your destination expects. The original bytes stay intact, including metadata and animation frames.

Open Image to Base64 · This tool needs JavaScript for image processing. The complete guide is available below.

UNDERSTAND THE RESULT

A little context before the next click.

Encoding, not compression

Base64 represents every three input bytes with four text characters, with padding for an incomplete group. The string is usually larger than the binary file. Encoding does not make a large image load faster or reduce its dimensions; resize or compress first when that is your goal.

Raw Base64 versus a data URL

Raw Base64 contains only the encoded bytes. A data URL adds a prefix such as data:image/png;base64, so a compatible browser field knows what it is looking at. Choose the form required by the receiving application. A JSON property that expects raw data may reject a complete URL.

The file stays the same

The preview does not become the source of the output. The tool encodes the original file bytes and detects the format from the image header. A JPEG with an unusual extension remains JPEG in the data URL. Embedded camera information and other metadata remain in the encoded payload.

HOW TO USE IT

From an original to a clear next step.

  1. Choose or drop one JPEG, PNG, or WebP image. Sample provides a transparent image for testing the workflow without choosing a personal file.
  2. Inspect the preview, detected format, displayed dimensions, and original byte size. An undecodable or oversized file produces an error instead of usable output.
  3. Select Data URL for a complete image source or Raw Base64 for the payload alone. The output text and character count update together.
  4. Copy code or save the output as a .txt file. Paste it into the intended field, then check that the destination supports that image format and input length.

EVERYDAY USES

Small image tasks, with room to see.

A self-contained example

Include a small image in a demo or bug report without depending on a separate image URL. The receiving page may still restrict data URLs through its content security policy.

An API payload

Prepare a string for a system that explicitly accepts Base64 images. Check whether it expects a MIME prefix and whether its size limit refers to the encoded text or decoded file.

An offline design asset

Keep a tiny graphic together with the document that uses it. For larger pictures, separate image files are often easier to maintain and cache.

YOUR IMAGE, YOUR DEVICE

Local processing. A separate result.

Files, code, and calculation values are processed in this browser and are not uploaded by the tool or saved in browser storage. Clear removes the working result. Leaving the page releases its temporary image URLs. Copies you put on the clipboard or download remain under your control. Share copies the tool address without your input.

Encoding preserves every original byte, including embedded metadata. A preview may apply EXIF orientation while the encoded data remains unchanged. Review what the original file contains before sending its code elsewhere.

JPEG, PNG, and WebP are supported, including animated PNG and WebP when the browser can display them. The original file or decoded payload must be at most 8 MB, 16 megapixels, and 16,384 pixels on either side. Base64 text input is limited to 12,582,912 characters. SVG, GIF, HEIC, and arbitrary documents are outside these two tools. File size labels use 1 KB = 1,000 bytes; 1 MB = 1,000,000 bytes.

Read the site privacy policy for the surrounding website.

File sizes and limits use decimal units: 1 KB = 1,000 bytes and 1 MB = 1,000,000 bytes. Rounded labels are for readability; target checks compare exact bytes.

KEEP IT NEARBY

One less search next time.

Bookmark this page with Ctrl + D on Windows or Command + D on a Mac. To make a desktop shortcut, use your browser’s shortcut or Add to Home Screen option when available. The shortcut opens the tool page; it does not include your image or settings.

Guide to adding a OneLess browser shortcut

Choose a OneLess shortcut icon

Download a PNG or ICO if your device lets you customize shortcut icons.

QUESTIONS, ANSWERED

Before you save or share.

Does this reduce image quality?

No. The original bytes are encoded without resizing or re-encoding. Decoding the generated string returns those bytes, provided the string is copied completely.

Is Base64 encryption?

No. Anyone with the string can decode it. It is a text representation, not a password or a privacy boundary. Only copy images you intend to share with the destination.

Can metadata survive?

Yes. EXIF and other metadata already present in the file remain present. This tool does not perform metadata removal.

Why is the output longer than the file?

Base64 uses four characters for each group of three bytes. A data URL also has a short MIME prefix. The screen reports characters and original bytes separately.

Can I encode SVG or GIF?

This release validates and previews JPEG, PNG, and WebP only. Use SVG to PNG when a raster copy of a supported static SVG is suitable.

What if Copy is unavailable?

Browser clipboard permissions can prevent copying. Select the read-only code manually or use Save .txt. Neither method uploads your image.

ANOTHER SMALL TASK?

Keep the next step close.

Ready for the image in front of you?

Turn an image into code, with the original bytes intact.

Return to Image to Base64 ↑