🍋
Menu
🍋 Image Tools

Image to Base64

Encode images as Base64 text for embedding in code.

Free Browser-only No sign-up
🍋
Drop
🫸
Squeeze
🍹
Fresh!

⚙️ Squeeze Settings

🍋

🍋

Freshly Squeezed!

Browse tools

About Image to Base64

Convert images to Base64-encoded text strings directly in your browser. Useful for embedding small images in HTML, CSS, JSON, or API payloads without separate file hosting.

How It Works

The file is read using the FileReader API's readAsDataURL method, which produces a Base64-encoded data URI. Optionally, the data URI prefix can be stripped to get raw Base64, and lines can be wrapped at 76 characters for MIME compatibility.

Step by Step

  1. 1 Upload an image (JPEG, PNG, WebP, GIF, SVG, or BMP)
  2. 2 Choose whether to include the data URI prefix
  3. 3 Optionally enable line wrapping for MIME format
  4. 4 Click Convert to generate the Base64 text
  5. 5 Download the text file or copy the output

Tips

  • Include the data URI prefix for direct use in HTML img src or CSS url().
  • Strip the prefix when using Base64 in API payloads or JSON fields.
  • Keep images small (< 50 KB) for inline embedding — larger images increase page size.

Frequently Asked Questions

What is the data URI prefix?
It's the 'data:image/png;base64,' part before the actual Base64 data. It tells browsers the data type.
When should I use Base64 encoding?
For small images (icons, logos < 50 KB) embedded in HTML/CSS, or when sending images in JSON APIs.