Skip to content
cosmodev ~/tools/base64

Base64 エンコード / デコード

Encoders & Crypto

テキストを Base64 にエンコード、またはデコードします。UTF-8 対応でブラウザ内で完結し、入力内容を共有可能なリンクで発行できます。

Base64
テキストを入力または貼り付けると Base64 が表示されます。

機能の説明

テキストを Base64Base64An encoding representing binary data as 64 safe ASCII characters, so it survives transport through text-only channels. It encodes — it does not encrypt. に変換し、また元のテキストに戻します。エンコードまたはデコードを選んで入力を貼り付けるだけで、出力がその場で即座に表示されます - 変換ボタンを押す必要はありません。複数行の入力にも対応し、不正な形式の Base64Base64An encoding representing binary data as 64 safe ASCII characters, so it survives transport through text-only channels. It encodes — it does not encrypt. は推測せずにエラーとして通知します。さらに、入力テキストと変換方向を共有リンクに含められるので、同僚がリンクを開くとまったく同じ変換結果がそのまま再現されます。

使い方

  1. 変換方向を選びます:エンコード(テキスト → Base64Base64An encoding representing binary data as 64 safe ASCII characters, so it survives transport through text-only channels. It encodes — it does not encrypt.)またはデコード(Base64Base64An encoding representing binary data as 64 safe ASCII characters, so it survives transport through text-only channels. It encodes — it does not encrypt. → テキスト)。
  2. 入力ボックスに貼り付けます。変換はタイプするそばから実行されます。
  3. 出力をコピーするか、入力と変換方向の両方を保持した共有リンクをコピーします。
  4. 不正な形式の Base64Base64An encoding representing binary data as 64 safe ASCII characters, so it survives transport through text-only channels. It encodes — it does not encrypt.(誤った文字、壊れたパディング)は、無言の文字化けではなくエラーとして表示されます - 入力を修正すれば、次のキー入力で即座に回復します。

例

方向 入力 出力
エンコード Hello, CosmoDev! SGVsbG8sIENvc21vRGV2IQ==
デコード Q29zbW9MYWJz CosmoLabs
エンコード multi\nline bXVsdGkKbGluZQ==

Base64Base64An encoding representing binary data as 64 safe ASCII characters, so it survives transport through text-only channels. It encodes — it does not encrypt. とは何か(そして何でないか)

Base64Base64An encoding representing binary data as 64 safe ASCII characters, so it survives transport through text-only channels. It encodes — it does not encrypt. は、任意の 3 バイトを、64 文字のアルファベット(A-Z、a-z、0-9、+、/、必要に応じて = でパディング)からなる 4 文字へと対応付けます。これにより、バイナリデータがテキストしか運べない経路 - データ URL、JSON のフィールド、メールの MIME パート、HTTP Basic 認証のヘッダー - を通過できるようになります。

重要な性質が 2 つあります:

  • 可逆ではあるが、秘密ではない。 出力は誰でもデコードできます。鍵というものが存在しません。Base64Base64An encoding representing binary data as 64 safe ASCII characters, so it survives transport through text-only channels. It encodes — it does not encrypt. を暗号化として扱ったり、認証情報を隠す手段として使ったりしてはいけません。
  • 約 33% 膨らむ。 3 バイトが 4 文字になるため、3 MB のファイルは 4 MB の文字列になります。トークンや小さなペイロードには問題なく使えますが、大きなメディアには不向きです。

近い親戚にあたる Base64url(JWTJWTA compact, URL-safe token that carries claims (like identity or expiry) between two parties, signed to prevent tampering.Learn more で使用されます)は +→- と /→_ を入れ替え、= のパディングを省くことで、文字列が URL の中で安全に扱えるようにします。このツールのデコードは通常の Base64Base64An encoding representing binary data as 64 safe ASCII characters, so it survives transport through text-only channels. It encodes — it does not encrypt. を受け付けます。JWTJWTA compact, URL-safe token that carries claims (like identity or expiry) between two parties, signed to prevent tampering.Learn more を扱う作業では、base64url 版を端から端まで処理できる JWT Debugger を使ってください。

補足事項

  • 不正な入力(紛れ込んだ余計な文字、途切れたパディング)は Invalid Base64 input と表示されます - コンバーターは文字化けを出力するくらいなら、推測することを拒否します。
  • UTF-8 が最初から最後まで尊重されます。アクセント付きの文字も絵文字も、エンコードとデコードが正しく往復します。
  • プライベート: 変換はブラウザーの中でローカルに実行されます。貼り付けた内容が外部に送信されることは一切ありません。
  • 関連ツール: JWTJWTA compact, URL-safe token that carries claims (like identity or expiry) between two parties, signed to prevent tampering.Learn more Debugger、URL Encode / Decode、HashHashA one-way function that maps data of any size to a fixed-length digest. Same input, same digest; any change, different digest; not reversible. Generator。
ソースコード14 言語

100% クライアント側で実行 · データがブラウザの外へ出ることはありません。 役に立ちましたか?チームメイトに共有してください。