Base64 Encode / Decode

Encode text to Base64 or decode Base64 to text

Input0 chars
Output0 chars

Enter text and click Encode/Decode to convert

About This Tool

Base64 is a binary-to-text encoding scheme that represents binary data using a set of 64 ASCII characters (A-Z, a-z, 0-9, +, /). It is commonly used to encode data for transmission over media designed to handle text, such as embedding images in HTML or CSS, encoding authentication credentials in HTTP headers, transmitting binary data in JSON or XML payloads, and attaching files in email messages using the MIME standard. Our free online Base64 encoder and decoder supports full UTF-8 encoding, so you can safely convert strings containing special characters, emojis, and multibyte characters. Base64 is also widely used in API authentication schemes like Basic Auth and for encoding binary data in data URIs. Simply paste your text or Base64 string and get instant results.

How to Use

  1. To encode text to Base64, paste your plain text into the input field. The tool supports any UTF-8 characters including emojis, accented letters, and symbols.
  2. The encoded Base64 string will appear in the output area immediately. Click the copy button to copy it to your clipboard for use in your code, HTML, or API request.
  3. To decode a Base64 string, paste the encoded string into the input area and switch to decode mode. The original text or binary data will be displayed in the output.
  4. Use the file upload option to encode files such as images or documents into Base64 strings, which is useful for embedding assets directly into HTML, CSS, or JSON.

Frequently Asked Questions

Base64 encoding is used to convert binary data into a text format that can be safely transmitted over text-based protocols. Common use cases include embedding images in HTML or CSS as data URIs, encoding Basic authentication credentials in HTTP headers, sending binary attachments in email (MIME), and including binary data in JSON payloads.
No, Base64 is an encoding scheme, not an encryption algorithm. It is trivially reversible and provides zero security. Anyone who sees a Base64 string can decode it. If you need to protect sensitive data, use proper encryption methods such as AES or RSA instead.
The equals signs are padding characters. Base64 encodes input in groups of 3 bytes (24 bits) into 4 characters (6 bits each). If the input length is not a multiple of 3, padding characters are added to make the output length a multiple of 4. One = means 1 byte of padding, and == means 2 bytes of padding.
No, Base64 is encoding not encryption. It can be easily decoded. Never use Base64 to store sensitive data like passwords. Use proper hashing algorithms like bcrypt or Argon2 for password storage.

Examples

Encode API Credentials

Create a Basic Auth header by encoding username:password

dXNlcjpwYXNzd29yZA==

Embed Image in HTML

Convert a small image to Base64 for inline embedding

data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==

Decode JWT Payload

Extract the middle section of a JWT token to view claims

eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ
Advertisement