Skip to main content
Back to Developer Tools

Base64 Encoder/Decoder

Convert between strings and Base64 encoding, supports text input and file processing

Input Settings
Example Data
Processing Results
Base64 Encoding Knowledge

What is Base64?

Base64 is an encoding method based on 64 printable characters to represent binary data. It converts every 3 bytes to 4 Base64 characters, commonly used for transmitting binary data in text protocols.

Application Scenarios

Base64 is widely used in email attachments, URL parameters, data URIs, small file storage and other scenarios. It ensures data is not corrupted or misinterpreted during transmission.

Encoding Characteristics

Base64 encoding increases data size by approximately 33% (every 3 bytes becomes 4 characters). It only contains A-Z, a-z, 0-9, +, /, = these 64 characters, ensuring safe transmission in most systems.

Security Notes

Base64 is not an encryption algorithm, it's just an encoding method. Encoded data can be decoded by anyone. Don't use Base64 to protect sensitive information, use real encryption algorithms instead.

Base64 encoding rule
Base64 represents binary data as printable ASCII characters by grouping bytes into 6-bit chunks.
Input bytes -> 24-bit groups
24-bit group -> four 6-bit values
Each 6-bit value maps to one Base64 character
Padding "=" is added when the final group has fewer than 24 bits
A-Z a-z 0-9 + /
Standard Base64 alphabet
The standard alphabet defined by RFC 4648 for common Base64 encoding.
=
Padding
Used at the end of encoded output when the input byte length is not divisible by 3.
UTF-8
Text encoding step
Text must be converted into bytes before Base64 encoding.
How this Base64 tool works
The tool encodes or decodes text locally in the browser for API payloads, config snippets, data URLs, and debugging.
  1. Read text input or file text content in the browser.
  2. For encoding, convert text into UTF-8 bytes before mapping it to Base64 characters.
  3. For decoding, validate and decode the Base64 text back into bytes, then display it as text.
  4. Show output length and size ratio so users can notice the expected Base64 expansion.
  5. Keep processing local to the browser; the input is not uploaded by this component.

Important notes

  • Base64 is encoding, not encryption. Anyone can decode it.
  • Binary files and very large payloads may need specialized file-safe handling.
  • Some systems use URL-safe Base64 with '-' and '_' instead of '+' and '/'.
Base64 examples
Use these examples to check API payloads and text encoding behavior.

Simple text

Encode a short value for a test request.

  • Input: Hello, World!

Output: SGVsbG8sIFdvcmxkIQ==

Padding appears because the byte count does not divide evenly into 3-byte groups.

JSON payload

Inspect a Base64-encoded configuration blob.

  • Input: {"env":"prod","enabled":true}

Decoded output should be valid JSON text.

Decode before editing, then re-encode after validating the JSON.

Unicode text

Encode non-ASCII characters safely.

  • Input: Hello 世界

Output depends on UTF-8 bytes, not character count.

Always confirm the expected text encoding when systems disagree.

Base64 FAQ
Common Base64 mistakes and security boundaries.