TopDev
🖼️

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 Browser-only
🖼️
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

Who this is for

Developers using ChatGPT/Claude/Gemini daily, AI engineers building RAG/agents, anyone paying LLM API and wanting quick metrics.

FAQ

Is my pasted data sent anywhere?

No. The tool runs 100% in your browser — no HTTP requests to TopDev servers or any AI provider. You can disconnect from the internet to verify.

Is this tool free forever?

Yes. All TopDev tools are free, no signup required, no usage limits.

Related tools

See all tools →