エンコード
Base64
Base64 エンコード・デコード — テキストとファイル、ブラウザ内で完結。
Base64 is a binary-to-text encoding that represents arbitrary bytes using 64 printable ASCII characters (A–Z, a–z, 0–9, plus + and /). It exists so binary data — images, archives, cryptographic keys — can pass unchanged through channels that were designed for text only.
This tool encodes and decodes both plain text and files. Everything runs client-side in your browser: the input never leaves your machine, which makes it safe for tokens, private keys, and other sensitive data.
How to use it
- Encode text: pick the Encode / Text mode, paste your string, and copy the Base64 result.
- Encode a file: switch to File mode and choose a file — you get its Base64 representation, ready for a data URI or JSON field.
- Decode: switch to Decode mode and paste a Base64 string; if it decodes to a known file type you can download the original file.
Common uses
- Embedding small images or fonts directly in CSS/HTML via data: URIs.
- Putting binary payloads inside JSON, XML, or form fields.
- Encoding credentials for the HTTP Basic Authorization header.
- Storing or transmitting PEM keys and certificates.
Things to keep in mind
Base64 is not encryption — anyone can decode it. It only changes the representation of data, not its confidentiality.
Encoded output is about 33% larger than the input because every 3 bytes become 4 characters.
For URLs and file names use Base64URL, which swaps + and / for - and _ and often drops the = padding.
よくある質問
Base64 とは何ですか?
バイナリデータを64種類の印字可能な英数字だけで表現するエンコード方式です。メールの添付ファイルやJSON、CSSへの画像埋め込みなど、バイナリをそのまま扱えない場所でテキストとして安全に受け渡すために使われます。
エンコード後にサイズが大きくなるのはなぜですか?
Base64は3バイトのデータを4文字に変換するため、出力は元のデータよりおよそ33%大きくなります。大きなファイルを扱う際は、この増加分を見込んでおく必要があります。
入力したデータはサーバーに送信されますか?
いいえ、このツールのエンコード・デコード処理はすべてブラウザ内のJavaScriptで完結しており、テキストもファイルも外部には送信されません。
標準のBase64とBase64URLは何が違いますか?
Base64URLでは + と / がそれぞれ - と _ に置き換えられており、追加のpercent-encodingなしでURLやファイル名に安全に埋め込めます。JWTもこの方式を使用しています。
末尾の = 記号は何を意味しますか?
これはパディングと呼ばれる文字で、最後の3バイトブロックで不足しているバイト数を示します。常に必須というわけではなく、一部のシステムでは意図的に省略されます。