Command Palette

Search for a command to run...

Base64

Base64 Converter

Encode and Decode Base64 data.

Input
Output

What

Base64 Converter definition

Base64 is an encoding scheme that converts binary data into ASCII text. It's widely used for email attachments, URL parameters, and API auth tokens.

Cases

Use Cases

1

When embedding an image as a data URI

2

When reading the payload of a JWT

3

When creating an HTTP Basic auth header

How To

How to Encode or Decode Base64

A step-by-step guide to converting text to and from Base64.

1

Enter text

Paste the text you want to convert into the input field.

2

Select mode

Choose the Encode or Decode tab.

3

Copy result

Click the copy button to save the converted result to your clipboard.

Knowledge

Understanding Base64 Encoding

What is Base64?
Base64 is a binary-to-text encoding scheme that represents binary data in an ASCII string format. It uses 64 printable characters (A-Z, a-z, 0-9, +, /) to encode data, making it safe for transmission over text-based protocols.
How Does Base64 Work?
Base64 divides binary data into 6-bit groups and maps each group to one of 64 characters. Since 6 bits can represent 64 values (2^6), this creates a compact representation. Padding with '=' is added when the input isn't evenly divisible by 3 bytes.
Base64 vs Encryption
Base64 is NOT encryption—it provides no security or secrecy. Anyone can decode Base64 data. It's purely for safe data transport, not data protection. Use proper encryption (AES, RSA) for sensitive data.
URL-Safe Base64
Standard Base64 uses '+' and '/' which have special meanings in URLs. URL-safe Base64 replaces these with '-' and '_', and often omits padding ('='). This variant is used in JWTs, filenames, and URL parameters.
Base64 Size Overhead
Base64 encoding increases data size by approximately 33% (4 output characters for every 3 input bytes). This makes it unsuitable for large files but acceptable for small data like tokens, thumbnails, or configuration values.

FAQ

Base64 converter FAQ

What is Base64 used for?
It encodes binary into ASCII text so it can travel safely in headers, JSON, or data URLs (like images).
Does Base64 encrypt data?
No—it's only encoding and gives no secrecy. Use HTTPS and proper encryption for sensitive content.
Why do decoding errors happen?
Input must be valid UTF-8/Base64 with correct padding (=). Trim whitespace and remove any data: URL prefix before decoding.
When should I use URL-safe Base64?
Use the URL-safe variant ( - and _ instead of + and /, often without padding) for query strings, JWT parts, and filenames.
Where did Base64 originate?
Base64 was popularized by MIME email standards in the 1990s to safely transmit binary attachments over text-only channels.
How widely used is Base64 now?
It's ubiquitous in web APIs, email, and SDKs because it's simple, standardized, and preserves binary data across text-only transports.
What are common Base64 use cases?
Embedding small images in HTML/CSS, carrying binary blobs in JSON, encoding credentials for basic auth, and representing cryptographic keys.
Any maintenance tips for Base64 data?
Avoid Base64 for large files due to ~33% size overhead; strip prefixes before decoding and keep URL-safe vs. standard variants consistent.
Base64 Converter