Ready

Image to Base64

Convert images to Base64 strings locally. Drag and drop an image to get copy-ready output.

All processing stays in your browser.

Tip: Great for embeds or data URIs.

Output mode

Compression helpers

Quality (JPEG/WebP): 0.86

Preview will appear here.

Output
Encoded output will appear here.

API / CLI snippets

// Browser: file input -> Base64
const fileInput = document.querySelector("input[type=file]");
fileInput.addEventListener("change", async (event) => {
  const file = event.target.files[0];
  const buffer = await file.arrayBuffer();
  const bytes = new Uint8Array(buffer);
  let binary = "";
  bytes.forEach((byte) => (binary += String.fromCharCode(byte)));
  const base64 = btoa(binary);
  const dataUrl = `data:${file.type};base64,${base64}`;
  console.log(dataUrl);
});

History

Stored locally in IndexedDB on this device only.

No history yet.

How to use

  1. Switch between Image → Base64 and Base64 → Image using the tabs.
  2. Choose output mode (data URL, raw Base64, CSS/HTML/JSON/Markdown snippets).
  3. Batch mode supports multiple files and gives size inflation stats.
  4. Use compression helpers to resize or convert PNG → WebP before encoding.

FAQ & privacy

Does this run locally? Yes, images never leave your browser.

Why Base64? Useful for data URIs and embedding small assets without hosting.

Formats? Common web formats (PNG/JPG/GIF) and other image/* types supported by your browser.

Size limits? Over ~10 MB is blocked; 5–10 MB shows a warning to prevent slowdowns.