Base64 エンコード/デコード

Free online Base64 encode and decode tool. Supports text conversion, file upload to Data URI, and URL Safe mode. All processing is done in your browser — your data never leaves your device.

Input Text

Base64 Result

Original length: 0 chars Base64 length: 0 chars Expansion: Mode: Encode

What is Base64?

Base64 is an encoding method that uses 64 printable characters to represent binary data. Since 2⁶=64, every 6 bits form a unit mapped to one printable character. Base64 is commonly used to transmit binary data in text-based protocols, such as Data URI in HTML/CSS and HTTP Basic Auth tokens.

How It Works

During encoding, every 3 bytes (24 bits) are split into 4 groups of 6 bits each, mapped to a Base64 table character. If data is less than 3 bytes, = padding is used. Decoding reverses this process, converting each Base64 character back to 6 bits and reassembling the original data.

Base64 Encoding Notes:

  • Encoded data is about 33% larger than original (3 bytes → 4 chars)
  • Printable characters: A-Z, a-z, 0-9, +, /
  • May include 1 or 2 = padding characters at the end
  • Fully reversible encoding (not encryption)

Common Use Cases

  • Data URI — Embed images, fonts and other binaries directly in HTML/CSS
  • HTTP Basic Auth — Username and password transmitted via Base64 encoding
  • JWT Token — Header and Payload of JSON Web Tokens use Base64 URL Safe encoding
  • API Token — Many API keys use Base64 encoding for storage and transmission
  • Email Attachments — MIME protocol uses Base64 for binary attachment transfer

Base64 Encoding Table

ValueCharValueCharValueCharValueChar
0A16Q32g48w
1B17R33h49x
2C18S34i50y
3D19T35j51z
4E20U36k520
5F21V37l531
6G22W38m542
7H23X39n553
8I24Y40o564
9J25Z41p575
10K26a42q586
11L27b43r597
12M28c44s608
13N29d45t619
14O30e46u62+
15P31f47v63/
Tip: When "URL Safe mode" is enabled, + becomes -, / becomes _, and trailing = is removed, making the result directly usable in URLs without additional encoding.