Base64 Encoder & Decoder

Instantly encode plain text to Base64 or decode Base64 strings back to readable text. Fast, secure, and client-side.

Characters
Invalid Base64 String!

The text you entered contains characters that cannot be decoded. Please check your input.

What is Base64?

Base64 is an encoding scheme that converts any data — text, images, files — into a string made of just 64 “safe” characters: uppercase and lowercase letters, digits, + and /. Many systems were built to carry plain text and can break when they meet raw binary data or unusual characters. Base64 wraps the data in a format these systems can carry without corrupting it.

You see Base64 every day without noticing: in email attachments, in images embedded directly in web pages, in the middle section of JSON Web Tokens (JWTs) and in HTTP Basic Authentication headers.

How to Use the Base64 Tool

  1. Choose Encode to Base64 or Decode from Base64.
  2. Type or paste your input. Use Paste to insert from the clipboard.
  3. The result appears immediately on the right. Copy it with one click.
  4. If you try to decode something that isn’t valid Base64, you’ll see a clear error instead of garbage output.

Examples

TextBase64
HelloSGVsbG8=
Hello, India!SGVsbG8sIEluZGlhIQ==
नमस्ते4KSo4KSu4KS44KWN4KSk4KWH

Notice that the Hindi word produces a longer string: each Devanagari character takes 3 bytes in UTF-8, and Base64 then adds about a third on top.

How Base64 Works

  1. The text is converted to bytes (using UTF-8).
  2. The bytes are split into groups of 3 (24 bits).
  3. Each 24-bit group is split into four 6-bit pieces.
  4. Each 6-bit value (0–63) is mapped to one character of the Base64 alphabet.
  5. If the last group has fewer than 3 bytes, = padding is added.

For “Man”, the bytes 77, 97, 110 become the bits 010011 010110 000101 101110, which map to TWFu.

Common Uses

  • Data URIs: embedding small images or icons directly in HTML or CSS, e.g. data:image/png;base64,iVBOR....
  • Email attachments: the MIME standard uses Base64 to send files through mail servers.
  • APIs: sending files or binary data inside JSON.
  • Authentication headers: HTTP Basic Auth sends username:password in Base64 — which is why it must only be used over HTTPS.
  • JWTs: the header and payload of a token are Base64URL-encoded and can be read by anyone.
Security reminder: Base64 offers zero protection. If you find a password or API key “hidden” in Base64 in code or a config file, treat it as plain text. Use real encryption or a secrets manager for sensitive data.

Base64 vs Base64URL

Standard Base64 uses + and /, which have special meanings in URLs. The URL-safe variant replaces them with - and _ and often drops the = padding. If a string from a URL or JWT fails to decode here, replace - with + and _ with /, then try again.

Related Tools

Frequently Asked Questions

Base64 is a way of representing binary data or any text using only 64 safe characters: A–Z, a–z, 0–9, + and /, with = used for padding. It lets data pass through systems that only handle plain text, such as email or JSON.
No. Base64 is an encoding, not encryption. Anyone can decode it instantly without a key, so it must never be used to hide passwords or sensitive information.
Base64 works on groups of 3 bytes. When the input length is not a multiple of 3, one or two = signs are added as padding so the output length is a multiple of 4.
Every 3 bytes of input become 4 characters of output, so encoded data is about 33% larger than the original.
Yes. Text is converted to UTF-8 bytes before encoding, so Hindi, other Indian scripts and emojis encode and decode correctly.
The input contains characters outside the Base64 alphabet, has been cut off, or uses the URL-safe variant (with - and _ instead of + and /). Check that you copied the full string.