📋 Codificador Base64
Converta imagens para URLs de dados Base64 e vice-versa.
🖼️ Testar com imagem de exemplo
Como Usar
1
Escolher Direção
Alterne entre Codificar (imagem→texto) ou Decodificar (texto→imagem).
2
Entrada
Envie uma imagem ou cole uma string Base64.
3
Obter Resultado
Copie o resultado ou baixe-o diretamente.
Guia Detalhada
Modo 1: Imagem → Base64 (Codificar)
Converta qualquer imagem em uma URL de dados Base64 para incorporar diretamente no código.
Switch between Encode and Decode modes using the tabs at the top
- Upload an image (JPG, PNG, WebP, GIF, BMP)
- Click "Encode to Base64"
- The full data URL appears in the text area (format:
data:image/png;base64,...) - Click "Copy" to copy to clipboard, or "Download as .txt" to save
When to use: Embed small icons directly in HTML/CSS to eliminate HTTP requests. Great for email signatures, single-file demos, and CSS background images.
Modo 2: Base64 → Imagem (Decodificar)
Converta uma string Base64 de volta para uma imagem visualizável e baixável.
- Switch to the "Base64 → Image" tab
- Paste a Base64 string or full data URL into the text area
- Click "Decode to Image"
- The decoded image appears below — click "Download Image" to save
Note: If you paste a raw Base64 string without the
data:image/... prefix, the tool will auto-detect and add the appropriate header.Melhores Casos de Uso
- Inline HTML images — Embed small icons and logos directly in HTML without external files
- CSS backgrounds — Use Base64 in
background-image: url()for self-contained stylesheets - Email signatures — Ensure images display correctly in email clients
- Single-file demos — Create standalone HTML files with embedded images
- API testing — Inspect and decode Base64 image data from API responses
Dicas Profissionais
- Base64 increases file size by approximately 33% — only use it for small images (<50KB ideally)
- Data URLs work in all modern browsers and most email clients
- For CSS, use
background-image: url('data:image/png;base64,...') - For HTML, use
<img src="data:image/png;base64,..."> - Very large images (>2MB) will produce extremely long strings that may slow down page rendering
Perguntas Frequentes
Base64 codifica dados binários como texto. Incorpora imagens em HTML/CSS.
Reduzem requisições HTTP. Úteis para ícones. Aumentam tamanho ~33%.
Imagens >5MB geram strings longas. Funciona melhor com <2MB.
Deve ser imagem válida (data:image/...). Sem prefixo detectado.