Free online Base64 encoder and decoder

Encode text to Base64 or decode Base64 to plain text—runs in your browser.

  • No upload
  • Instant convert
  • Free

About the Base64 Encoder Decoder

Encode a short string to standard Base64 or decode a Base64 value back to text: an HTTP Basic Auth header, a value from a Kubernetes Secret, or a field in an API response. Pick Encode or Decode, paste, and click Convert. Text is encoded as UTF-8 first, so accents, non-Latin scripts and emoji work, as covered below.

How to use the Base64 Encoder Decoder

  1. Choose Encode or Decode in the Mode menu.
  2. Paste your text or Base64 string into Input.
  3. Click Convert; the result appears below the button.
  4. If the browser shows an error alert, check the troubleshooting notes below.

Worked example: building an HTTP Basic Auth header

Basic Auth sends username:password as Base64. Encoding the credentials user and p@ss:

Input (Encode)
user:p@ss
Output
dXNlcjpwQHNz
Header to send
Authorization: Basic dXNlcjpwQHNz
InputModeOutput
Hello, World!EncodeSGVsbG8sIFdvcmxkIQ==
SGVsbG8sIFdvcmxkIQ==DecodeHello, World!
SGVsbG8sIFdvcmxkIQ (padding removed)DecodeHello, World!

Non-English text and emoji

Text is converted to UTF-8 bytes before encoding, the same as Python's base64 module or Node's Buffer, so é becomes w6k= and an emoji such as 😀 becomes 8J+YgA==. Decoding turns the bytes back into UTF-8 text, so accented characters come back intact rather than as garbled letters such as é. Base64url input (with - and _ instead of + and /) and missing = padding are accepted when decoding.

For plain ASCII values such as tokens, credentials, keys and most config strings, both approaches give the same result. If you need to embed a binary file rather than text, use Image to Base64 for images or check a token's contents with the JWT decoder.

What Base64 encoding actually does

Base64 converts binary data into a string of 64 printable ASCII characters (A-Z, a-z, 0-9, +, /). The name comes from the 64-character alphabet used. Every 3 bytes of input become 4 Base64 characters, expanding the data size by approximately 33%. Padding characters (=) fill the last group when the input is not a multiple of 3 bytes.

The encoding exists because many systems — email protocols, HTTP headers, JSON fields — were designed for plain text and cannot safely carry arbitrary binary data. Base64 gives binary data a text-safe representation that passes through these systems without corruption.

Base64 is not encryption

This is the most common misconception about Base64. It is an encoding scheme, not a security mechanism. Anyone can decode Base64 instantly without a key or password. Storing a password or API secret as a Base64 string does not protect it — it only obscures it from casual inspection.

For actual security, use encryption (AES-256, RSA) or cryptographic hashing (bcrypt, Argon2 for passwords; SHA-256 for data integrity). Reserve Base64 for its intended purpose: encoding binary data for text-based transport.

Common use cases

Email attachments use Base64 (via MIME) to embed binary files inside plain-text email messages. Web developers use Base64 data URIs to inline small images or fonts directly in CSS and HTML, eliminating extra HTTP requests. REST APIs that exchange binary data (audio clips, generated images, PDF previews) often Base64-encode the payload inside a JSON string field to avoid multipart encoding complexity.

HTTP Basic Authentication sends credentials as Base64-encoded "username:password". While this looks obfuscated, it is trivially decodable — it relies on HTTPS for actual security, not the Base64 layer. JSON Web Tokens (JWTs) also use Base64url (a URL-safe variant) to encode their header and payload sections.

URL-safe Base64 replaces + with - and / with _ to make encoded strings safe in URLs and filenames. This variant is used in JWTs, OAuth tokens, and URL parameters. The standard encoder on this page uses the standard alphabet; switch to URL-safe mode if you need the variant for web contexts.

Debugging Base64 problems

A common issue is line breaks: some Base64 implementations insert newlines every 76 characters (MIME standard). When pasting into a decoder, strip line breaks first. Another issue is the URL-safe vs standard alphabet: if your encoded string contains - or _, it uses URL-safe Base64 — swap those characters back to + and / before decoding with a standard decoder.

Incorrect padding is another frequent error. Base64 strings must have length divisible by 4. If yours is not, add = characters at the end until it is. Most decoders handle missing padding automatically, but strict implementations throw errors. The browser's atob() function, for example, requires valid padding.

Base64 Encoder Decoder: frequently asked questions

Is Base64 the same as encryption?
No. Base64 is an encoding scheme, not encryption. It converts binary data to ASCII text for safe transport. Anyone can decode Base64 without a key. Do not use it to protect sensitive data.
What is Base64 commonly used for?
Base64 is used in email attachments (MIME), embedding images in HTML and CSS, storing binary data in JSON APIs, and encoding credentials in HTTP Basic Auth headers.
Is my data sent to a server when I encode or decode?
No. All encoding and decoding runs locally in your browser. Your data is never uploaded to any server.
Why does my Base64 string end with == or =?
Base64 encodes 3 bytes as 4 characters. When the input is not a multiple of 3 bytes, padding characters (=) are added to make the output length a multiple of 4.