Base64 エンコード/デコード

ブラウザで Base64 変換

Input

Loading editor...

Output

Loading editor...

Encode and decode Base64 without trusting an online server

Base64 shows up everywhere — JWT payloads, image data URIs, email attachments, API request bodies. Encoding and decoding it in your browser keeps the data on your machine, which matters when the value is a token, a secret, or anything else you'd rather not paste into a remote service.

Use the tool when you need to

Decode a Base64-encoded value from a header

Inspect Authorization headers, encoded query parameters, or other Base64 strings safely in the browser.

Encode binary data for an API

Convert a small image or file into a Base64 string for inclusion in a JSON request body.

Flip between Base64 and Base64URL

Switch encoding variants when working with JWTs and URL-safe payloads.

How to encode or decode Base64 quickly

  1. 1

    Paste the input into the text area.

  2. 2

    Click Encode or Decode based on the direction you need.

  3. 3

    Copy the result, or download it as a file when working with binary data.

Common Base64 workflows

Inspect an Authorization header

Decode a Basic auth header to see the raw username and password format being sent.

Embed a small asset in JSON

Encode a tiny image as a data URI and embed it directly in an API request body.

Round-trip token payloads

Decode a JWT segment, edit it, and re-encode it for testing — without server-side help.

関連ツール

よくある質問

Base64は、バイナリデータをASCII文字列に変換するためのエンコード方式です。64種類の印字可能文字(A-Z, a-z, 0-9, +, /)で表現するため、JSON/XML/HTMLやメールのようなテキストベースの形式にバイナリを埋め込む用途でよく使われます。なお、エンコード後のサイズは元データよりおよそ33%増えます。

入力欄にテキストを貼り付けて「Encode」をクリックしてください。このツールは文字列をUTF-8のバイト列に変換したうえでBase64表現にします。結果は「Copy」でコピーできます。

よくある用途は、CSS/HTMLへの小さな画像の埋め込み(data URI)、JSON APIでのバイナリ送信、アップロード用にファイル内容を文字列化するケース、メール添付(MIME)、テキストのみのDBにバイナリを保存するケースなどです。

通常のBase64は + と / を使いますが、これらはURL内ではエスケープが必要になることがあります。Base64URLは + を - に、/ を _ に置き換え、さらにパディング(=)を省略します。JWTはトークンがURLで扱われることが多いため、Base64URLが使われます。