Toolypet
開発ツール/Base64エンコーダー/デコーダー

Base64エンコーダー/デコーダー

テキストをBase64にエンコードまたはBase64をテキストにデコード

入力

出力

結果がここに表示されます...

オプション

Base64 Encoding Guide

Learn how to use Base64 encoding and decoding effectively

What is Base64?

Base64 is a binary-to-text encoding scheme that represents binary data in an ASCII string format. It's commonly used to encode binary data for transmission over text-based protocols like email or to embed binary data in JSON, XML, or HTML.

How to Use This Tool

  1. Enter text or a Base64 string in the input field
  2. Click 'Encode' to convert text to Base64
  3. Click 'Decode' to convert Base64 back to text
  4. Copy the result using the copy button

Pro Tips

  • Base64 encoding increases data size by approximately 33%
  • Use the swap button to quickly reverse encode/decode operations
  • Base64 is not encryption - it's encoding and can be easily decoded

Browser Support

Base64 encoding/decoding is supported in all modern browsers using the built-in btoa() and atob() functions. This tool also handles UTF-8 characters properly.

よくある質問

Base64は暗号化ですか?

いいえ、Base64は暗号化ではなくエンコーディングです。誰でも簡単にデコードできるため、セキュリティ目的で使用すべきではありません。Base64はバイナリデータをテキスト形式で転送するためのもので、データを保護するためのものではありません。

Base64エンコードするとサイズはどのくらい増加しますか?

Base64は元のデータの約33%サイズが増加します。3バイトのバイナリデータが4つのASCII文字に変換されるためです。大容量ファイルではこのオーバーヘッドが相当になる可能性があるので注意してください。

画像をBase64に変換する理由は何ですか?

画像をBase64に変換すると、HTMLやCSSに直接埋め込むことができ、HTTPリクエスト数が減少します。小さなアイコンやロゴに便利ですが、大きな画像はサイズ増加とキャッシュ不可のため、別ファイルとして維持することをお勧めします。

日本語や絵文字もBase64でエンコードできますか?

はい、可能です。このツールはUTF-8エンコーディングを処理して、日本語、絵文字、特殊文字などすべてのUnicode文字を正しくBase64に変換します。標準のbtoa()はLatin1文字のみサポートしますが、このツールはUTF-8を完全にサポートします。

Base64文字列はどのように識別しますか?

Base64文字列はA-Z、a-z、0-9、+、/の文字のみを含み、末尾にパディングとして=文字がある場合があります。URL-safe Base64は+と/の代わりに-と_を使用します。長さは常に4の倍数です。