コンテンツへスキップ
uencoder

Base64 と Base32 と Base58:エンコード方式の違いと選び方

3 つの代表的な Base 系エンコード方式を比較し、それぞれを選ぶべき場面を学びます。

问题

ユースケースに合った Base 系エンコード方式を選ぶ必要がありますが、Base64、Base32、Base58 の違いがよくわかりません。

前提条件

  • 位取り記数法の一般的な理解
  • 対象システムの文字セット制約への認識

ステップ

  1. 1. Compare the alphabets

    Base64 uses 64 characters including + and /. Base32 uses 32 characters (A-Z, 2-7) and is case-insensitive. Base58 uses 58 characters, deliberately omitting 0, O, I, and l to avoid human-readability confusion.

    入力
    same input: 0x4d
    输出
    Base64: TQ== | Base32: MY====== | Base58: n
  2. 2. Evaluate the trade-offs

    Base64 is the most compact but uses characters that need URL encoding. Base32 is longer but safe for case-insensitive systems and filenames. Base58 avoids ambiguous characters, making it ideal for user-facing codes like Bitcoin addresses.

    入力
    compactness: Base64 > Base58 > Base32
    输出
    human-readability: Base58 > Base32 > Base64
  3. 3. Choose based on context

    Use Base64 for data transport in JSON or MIME. Use Base32 for filenames or case-insensitive systems. Use Base58 for short links, payment addresses, or any code humans must transcribe.

    入力
    URL payload
    输出
    choose Base64url or Base58

期待される結果

コンパクトさ、人間にとっての読みやすさ、文字セットの安全性に基づいて、どのエンコーディングを使うべきかを説明できる明確な判断根拠。

よくあるエラー

Using Base64 in a URL without URL-encoding + and /
Switch to Base64url (replace + with -, / with _) or use Base58 to avoid URL-unsafe characters entirely.

トラブルシューティング指引

  • If users mistype codes, switch from Base64 to Base58 to eliminate ambiguous characters.
  • If a system is case-insensitive, use Base32 instead of Base64.

セキュリティ上の制限

  • None of these encodings provide confidentiality. They are reversible by design.

関連ツール

関連用語

参考链接