🔤 Base64 Encode / Decode

Convert text to Base64 or decode Base64 back to plain text, instantly, entirely in your browser.

✍️ Input
Converted live as you type, entirely in your browser. Nothing is sent to a server.
📤 Output
🔤

Type or paste text to see the converted output

Guide

About the Base64 Encode / Decode Tool

Last updated: August 2026 · Reviewed by the NeftCal editorial team

This free Base64 encoder and decoder converts plain text into Base64 format, or decodes Base64 strings back into readable text — instantly, live, and entirely inside your browser. Base64 is a standard way to represent binary or text data using only safe, printable ASCII characters, widely used in web development, email, APIs, and data URIs.

How It Works

Choose Encode to convert your text into its Base64 representation, or Decode to convert a Base64 string back into plain text. Internally, the tool first converts your input into UTF-8 bytes, then maps those bytes through the standard 64-character Base64 alphabet (A-Z, a-z, 0-9, +, /), padding the result with = characters as needed so the output length is always a multiple of four.

Who Should Use This Tool

Developers debugging API payloads or JWT tokens, anyone decoding a Base64-encoded email attachment or data URI, and students learning how binary-to-text encoding works. It's a quick, no-signup alternative to running btoa()/atob() in a browser console.

Real-World Applications

  • Embedding small images or fonts directly in CSS or HTML using data URIs
  • Decoding the header or payload segments of a JWT (JSON Web Token) for debugging
  • Encoding credentials for HTTP Basic Authentication headers
  • Safely transmitting binary attachments inside JSON or XML API payloads
  • Reading Base64-encoded configuration values in environment variables or Kubernetes secrets

Tips for Accurate Results

  • Base64 is not encryption — never use it alone to protect sensitive data like passwords or API keys.
  • If decoding fails, check for missing padding (=) or stray whitespace/line breaks copied along with the string.
  • Standard Base64 uses + and / — some systems (like URLs and filenames) use a variant called Base64URL, which swaps those for - and _.
  • This tool handles UTF-8 text correctly, so emoji and non-Latin characters round-trip without corruption.
Formula

How Base64 Encoding Works

The bit-level process behind the conversion

Step 1 — Group Into 3-Byte Chunks
Input bytes are grouped into sets of 3 (24 bits total)

Step 2 — Split Into 4 Groups of 6 Bits
Each 24-bit chunk is split into four 6-bit values (0-63)

Step 3 — Map to the Base64 Alphabet
Each 6-bit value (0-63) maps to one of 64 characters: A-Z, a-z, 0-9, +, /

Step 4 — Pad if Needed
If the final chunk has fewer than 3 bytes, output is padded with = so the total length is a multiple of 4
🔢

64-Character Alphabet

Base64 uses 26 uppercase letters, 26 lowercase letters, 10 digits, and 2 symbols (+ and /) — 64 total printable characters, hence the name.

📦

~33% Size Increase

Because 3 bytes become 4 characters, encoded output is always about a third larger than the original binary data.

🔓

Not Encryption

Base64 is fully reversible with no key — it provides no confidentiality, only a safe text representation of binary data.

⚙️ Why This Format Works

Many text-based protocols and formats (email, JSON, XML, URLs) were designed around printable ASCII and can corrupt or mishandle raw binary bytes — control characters, null bytes, or non-UTF-8 sequences. Base64 sidesteps this entirely by re-encoding any binary data as a fixed, safe set of ASCII characters that survive any text-safe transport unchanged.

🎯 When to Use It

  • Embedding binary data (images, files) inside text formats like JSON, XML, or data URIs
  • Encoding credentials for HTTP Basic Auth headers
  • Debugging or decoding JWT tokens

📋 Assumptions

  • Input text is treated as UTF-8 encoded when encoding
  • Decoded output is displayed assuming the original data was UTF-8 text
  • Standard Base64 alphabet (RFC 4648), not the URL-safe variant

⚠️ Limitations

  • Provides no encryption or security — it's an encoding, not a cipher
  • Increases data size by roughly 33%
  • Decoding non-UTF-8 binary data (like a raw image) as text will show garbled characters, not an error
Walkthrough

Step-by-Step: How to Use This Tool

From choosing a mode to copying your result

Choose a mode

Select Encode to convert plain text to Base64, or Decode to convert Base64 back to plain text.

Enter your text

Type or paste the text or Base64 string into the input box.

Read the result

The converted output appears instantly below, ready to copy.

Example

Worked Example

Encoding a short greeting

Encoding "Hello, NeftCal!"

Input TextHello, NeftCal!
Byte Length15 bytes
Step 1: The text is converted to its UTF-8 byte values, then grouped into 3-byte chunks.
Step 2: Each chunk is split into four 6-bit values and mapped through the Base64 alphabet, with the final incomplete chunk padded with =.
Base64 Output
SGVsbG8sIE5lZnRDYWwh
Use Cases

Practical Use Cases for Base64

Where this encoding shows up day to day

🖼️

Data URIs

Embedding small images or icons directly inside CSS or HTML without a separate file request.

🔑

JWT debugging

Decoding the header and payload segments of a JSON Web Token to inspect its claims.

📧

Email attachments

MIME email encodes binary attachments as Base64 so they survive text-only mail transport.

🔐

HTTP Basic Auth

Encoding a username:password pair for the Authorization header.

⚙️

Config & secrets

Kubernetes secrets and many config formats store binary or sensitive values as Base64 text.

Pros & Cons

Advantages and Limitations

What this tool does well, and where Base64 itself has boundaries

✅ Advantages

  • Free, instant, and requires no signup
  • Runs entirely in your browser — nothing is sent to a server
  • Correctly handles UTF-8 text, including emoji and non-Latin scripts
  • Clear error messages for invalid Base64 input
  • One-click copy for the converted result

⚠️ Limitations

  • Base64 provides no encryption or confidentiality
  • Encoded output is about 33% larger than the original data
  • Does not support the URL-safe Base64 variant (-, _ instead of +, /)
Reference

Common Mistakes and Expert Tips

Get accurate results every time

❌ Common Mistakes

  • Assuming Base64 encryption protects sensitive data — it does not
  • Copying a Base64 string with extra line breaks or spaces, causing decode errors
  • Confusing standard Base64 with the URL-safe variant used in JWTs and some URLs
  • Expecting decoded binary (like an image) to display as readable text

💡 Expert Tips & Best Practices

  • If a Base64 string fails to decode, check for missing = padding at the end
  • Use actual encryption, not Base64, for anything that needs to stay confidential
  • Trim whitespace and line breaks from copied Base64 strings before decoding
  • Remember decoded output is only readable if the original data was text
📝

Summary: This tool encodes text to Base64 or decodes Base64 back to text, instantly and entirely client-side — useful for debugging APIs, JWTs, and data URIs. Pair it with the URL Encode / Decode tool for other text-encoding needs.

FAQ

Frequently Asked Questions

Common questions about Base64 encoding

What is Base64 encoding?
Base64 is a method of representing binary data using only 64 printable ASCII characters (A-Z, a-z, 0-9, +, /). It's commonly used to safely embed binary or text data — like images, files, or credentials — inside text-based formats such as JSON, XML, HTML, URLs, or email, which can't reliably handle raw binary bytes.
Is Base64 encoding a form of encryption?
No. Base64 is an encoding scheme, not encryption — it provides zero security or confidentiality. Anyone can decode a Base64 string back to its original form instantly with no key required. Never use Base64 alone to protect sensitive data like passwords; use actual encryption for that.
Why does encoded Base64 text look longer than the original?
Base64 encodes every 3 bytes of input as 4 output characters, so encoded text is roughly 33% longer than the original. This overhead is the trade-off for representing arbitrary binary data using only safe, printable ASCII characters.
Why do some Base64 strings end with = or == ?
The equals sign is padding. Base64 processes input in groups of 3 bytes; when the final group has only 1 or 2 bytes, padding characters (= or ==) are added to keep the output length a multiple of 4, signaling how much of the last group is padding rather than real data.
Does this tool support emoji and non-English text?
Yes. This tool encodes text as UTF-8 bytes before Base64-encoding, so emoji, accented characters, and non-Latin scripts (like Chinese, Arabic, or Cyrillic) round-trip correctly through encode and decode.
What happens if I try to decode text that isn't valid Base64?
The tool will show an error message instead of garbled output. Valid Base64 only contains the characters A-Z, a-z, 0-9, +, /, and optional = padding at the end — anything else means the input isn't valid Base64.
Is my text sent to a server when I use this tool?
No. All encoding and decoding happens locally in your browser using JavaScript's built-in btoa/atob functions combined with UTF-8 handling. Nothing you type is transmitted, logged, or stored anywhere.
Learn More

Authoritative Resources on Base64

Technical references to complement this tool

Related Calculators

Other internet and developer tools