画像 → Base64変換ツール
画像ファイルをBase64文字列に変換します。HTML、CSSに直接埋め込めるBase64コードを生成します。
Click or drag and drop an image here
Supports: JPG, PNG, GIF, WebP (Max 10MB)
About Base64 Images
Base64 encoding converts images into text format that can be embedded directly in HTML, CSS, or JSON. This eliminates the need for separate image files and reduces HTTP requests.
Advantages
- No additional HTTP requests - faster page load
- Perfect for small icons and logos
- Works well in email templates
- Self-contained HTML files
Disadvantages
- Increases file size by ~33%
- Cannot be cached separately by browsers
- Not suitable for large images
- Makes code less readable
Best Practices
- Use for small images (icons, bullets) under 10KB
- Optimize images before converting
- Consider SVG for vector graphics instead
- Use traditional image files for photos
主な機能
📤 簡単なアップロード
- クリックしてファイル選択
- ドラッグ&ドロップサポート
- 最大10MBまでサポート
🖼️ プレビュー
- アップロードした画像を即座にプレビュー
- 画像情報の表示(サイズ、解像度、タイプ)
- Base64データサイズの計算
💻 コードスニペット
- HTML
<img>タグの例 - CSS
background-imageの例 - ワンクリックコピー機能
💾 エクスポート
- Base64文字列のコピー
- HTML/CSSコードのコピー
Base64エンコードとは?
Base64はバイナリデータをテキスト形式に変換するエンコード方式です。画像をBase64にエンコードすると、HTMLやCSSに直接含めることができます。
通常の画像 vs Base64
通常の方法:
<img src="image.png" alt="画像" />
Base64の方法:
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA..." alt="画像" />
メリット
✅ HTTPリクエストの削減
- 追加のファイルダウンロード不要
- ページ読み込み時間の短縮(小さな画像の場合)
✅ 単一ファイルで完結
- HTMLファイル1つですべてを含む
- メールHTMLに最適