Sổ Tay AI
🖼️

Image to Base64 Encoder for LLM Vision

Drop an image → base64 ready for Claude / GPT-4V / Gemini vision APIs. Encode + decode reverse, with data: URI prefix.

All tools
🖼️
Drop an image here
or
JPG / PNG / GIF / WebP / SVG · Max 10MB

Or decode reverse: Base64 → Image

Encode images to base64 for LLM vision APIs (Claude, GPT-4V, Gemini), inline CSS, or data URIs. Note: base64 is ~33% larger than the original — avoid for images > 100KB on production sites.

When to encode images to base64

Using with the Claude API

POST https://api.anthropic.com/v1/messages
{
  "model": "claude-sonnet-4-7",
  "messages": [{
    "role": "user",
    "content": [
      {
        "type": "image",
        "source": {
          "type": "base64",
          "media_type": "image/jpeg",
          "data": "/9j/4AAQSkZJRgABAQAAAQ..." // base64 from this tool (NO data: prefix)
        }
      },
      { "type": "text", "text": "Describe this image" }
    ]
  }]
}

Note: Claude wants raw base64 (NO data:image/...;base64, prefix). Uncheck "Include data: URI prefix" for the clean string.

Using with OpenAI GPT-4V

OpenAI is the opposite — it wants the full data URL with prefix:

{
  "type": "image_url",
  "image_url": {
    "url": "data:image/jpeg;base64,/9j/4AAQ..." // WITH prefix
  }
}

Size considerations

Privacy

The tool runs 100% in your browser. Images are NOT uploaded to SoTayAI or anywhere else. It still works with your network disconnected.

Related

Related tools

See all tools →