All image tools

Image to Base64

Get a data URL for embedding inline. Files never leave your browser.

About Image to Base64 · বিস্তারিত

Image to Base64 reads an image file and gives you its full data URL, for example data:image/png;base64,iVBOR..., ready to copy. You can paste it straight into an HTML img tag, a CSS background or a JSON field so the picture travels inside the code.

Base64 writes binary data using 64 plain text characters. A data URL adds a short prefix naming the file type, so browsers can display the picture without a separate file or request.

The encoding is about one third larger than the original file, because every 3 bytes become 4 characters. That is fine for small icons, logos and email signature images, but large photos are better linked as normal files.

How to use it · কীভাবে ব্যবহার করবেন

  1. Pick an image

    Choose a PNG, JPG, SVG, WEBP, GIF or other image file.

  2. Encode it

    Press Run Image to Base64; the data URL appears in a text box with its length.

  3. Copy and paste

    Click Copy data URL and paste it into your HTML, CSS, JSON or code.

When it helps · কখন কাজে লাগে

Small icons inside CSS
Embedding a tiny icon as background-image: url(data:...) saves a network request on a web page.
Self-contained HTML files
Reports, invoices or offline pages can include a logo inside the HTML so the file works when emailed or opened without internet.
APIs and test data
Some APIs accept images as base64 strings in JSON; developers can paste a sample image into a request body.

Example: a 6 KB logo

A 6,000-byte PNG logo becomes a data URL of about 8,000 base64 characters plus the 22-character prefix data:image/png;base64, which you can drop into an img src attribute.

What you get

  • Full data URL including the MIME type prefix
  • One-click copy button
  • Shows the length of the encoded text
  • Works with any image type the file picker accepts
  • Encoding happens locally with the browser's FileReader

বাংলায়: ছবি থেকে Base64

ওয়েব ডেভেলপার বা প্রোগ্রামারদের অনেক সময় ছবিকে টেক্সট হিসেবে HTML, CSS বা JSON-এর ভেতরে বসাতে হয়। এই টুল ব্রাউজারেই ছবিকে পুরো data URL (data:image/png;base64,...) বানিয়ে দেয়, এক ক্লিকে কপি করা যায়। Base64 টেক্সট মূল ফাইলের চেয়ে প্রায় এক-তৃতীয়াংশ বড় হয়, তাই ছোট আইকন বা লোগোর জন্যই এটা উপযুক্ত।

HTML-এ কীভাবে ব্যবহার করব?

কপি করা লেখাটা img ট্যাগের src-এ বসিয়ে দিন।

Base64 বড় হয় কেন?

প্রতি ৩ বাইট ৪টি অক্ষরে লেখা হয়, তাই প্রায় ৩৩% বড় হয়।

Questions people ask · প্রশ্ন ও উত্তর

How do I use the data URL in HTML?

Put it in the src attribute of an img tag, exactly as copied, starting with data:image. The browser shows the picture without loading any other file.

Why is the base64 text bigger than my image?

Base64 represents every 3 bytes with 4 text characters, so the result is about 33% larger. That is the cost of carrying an image as text.

Should I base64-encode big photos for my website?

Usually no. Large data URLs make HTML and CSS heavy and cannot be cached separately. Keep base64 for small icons and logos, ideally a few KB.

Does the result include the data:image prefix?

Yes. The copied text is a complete data URL. If an API wants only the raw base64, delete everything up to and including the comma.

Is my image sent anywhere?

No. Your browser reads the file and encodes it locally, so the picture stays on your device.

More like this in Image tools. Need a version built for your business? Ask us.