Skip to main content

DigitalCalculators.net

Base64 Encoder and Decoder

Last updated By the DigitalCalculators.net team Free, no sign-up

Decode Base64 to text or encode text to Base64. Works with any language and emoji (UTF-8), and with URL-safe Base64.

Results

Result
ItemValue
Base64 follows RFC 4648. Text is turned into bytes with UTF-8 before encoding, and decoded bytes are read as UTF-8. Base64 is an encoding, not encryption: anyone can decode it. Nothing is sent or saved.

Quick Answer

Paste Base64 and press Convert to read it as text: SGVsbG8sIHdvcmxkIQ== decodes to Hello, world! To encode, choose Text to Base64 and type your text. Base64 makes data about 33% larger, and it is not a way to keep secrets because anyone can decode it.

Last updated: 15 November 2026 ·How we calculate this: how Base64 works

How This Base64 Tool Works

Base64 turns any data into plain letters, digits and a few symbols so it can travel safely through email, URLs, JSON and other systems built for text. This tool decodes Base64 back to readable text, or encodes your text as Base64, entirely in your browser.

Features:

  • Decode and encode: both directions, updated as you type.
  • UTF-8: accents, other alphabets and emoji work correctly.
  • URL-safe Base64: uses – and _ instead of + and /.
  • Binary data: if the result is not text, the bytes are shown in hex.

How to Use the Base64 Encoder and Decoder

  1. Choose decode or encode.
  2. Choose the standard or URL-safe alphabet.
  3. Paste the Base64 or type your text.
  4. Read the result, which updates as you type.
  5. Press Copy to copy it.

How Base64 Works

  • Groups of 3 bytes: 24 bits are split into four 6-bit numbers from 0 to 63.
  • Alphabet: 0 to 25 are A to Z, 26 to 51 are a to z, 52 to 61 are 0 to 9, 62 is + and 63 is /.
  • Padding: if the data does not fill the last group, = or == is added.
  • Size: every 3 bytes become 4 characters, about 33% larger.
  • URL-safe: RFC 4648 section 5 swaps + for – and / for _, so the result can sit in a URL.

Key Terms

  • Base64: a way to write bytes using 64 safe characters.
  • Padding: = signs that fill the last group of 4 characters.
  • UTF-8: the common way to store text as bytes.
  • URL-safe Base64: Base64 with – and _ instead of + and /.

Worked Example

Encode the word Man.

  • Bytes: M = 77, a = 97, n = 110
  • Bits: 01001101 01100001 01101110
  • Split into 6 bits: 010011 010110 000101 101110 = 19, 22, 5, 46
  • Letters: 19 = T, 22 = W, 5 = F, 46 = u, so Man becomes TWFu

Real-Life Examples

  • Reading data: SGVsbG8= decodes to Hello.
  • Size planning: a 30-byte text becomes 40 Base64 characters.
  • Web tokens: the parts of a JWT use URL-safe Base64.
  • Email: attachments are sent as Base64 text.

Base64 vs URL Encoding

  • Base64: turns any bytes into a 64-character alphabet; the result looks nothing like the input.
  • URL encoding: keeps normal letters and replaces only unsafe characters with %XX codes.
  • When to use which: Base64 for binary data, URL encoding for text inside web addresses.

Encode text for links with the URL Encoder and Decoder.

Base64 Alphabet

From RFC 4648, sections 4 and 5.

ValuesCharacters
0 to 25A to Z
26 to 51a to z
52 to 610 to 9
62+ (URL-safe: -)
63/ (URL-safe: _)
Padding=

Base64 Is Not Encryption

  • Anyone can decode it: never use Base64 to hide passwords or personal data.
  • Use real encryption: for secrets, use proper encryption tools.
  • Watch the variant: standard and URL-safe Base64 differ in two characters.
  • Line breaks: email Base64 is often split into lines; spaces and line breaks are ignored when decoding.

Common Mistakes to Avoid

  • Treating Base64 as encryption. It hides nothing.
  • Mixing variants. URL-safe Base64 uses – and _.
  • Dropping padding. Some systems need the = at the end; this tool adds it back when decoding.
  • Wrong text encoding. Text encoded as something other than UTF-8 may decode as odd characters.
  • Copying extra characters. Quotes or labels around the Base64 cause errors.

Frequently Asked Questions

Paste it, keep Base64 to text selected, and read the result.

Choose Text to Base64 and type your text.

No. Anyone can decode it, so it does not protect secrets.

They are padding added when the data does not fill the last group of 3 bytes.

Every 3 bytes become 4 characters, so it is about 33% larger.

A version that uses – and _ instead of + and /, so it works inside web addresses.

No. Everything runs in your browser.

The tool shows the first bytes in hex, because they are not readable text.

Yes. Text is encoded as UTF-8 first, so emoji and accents work.

The data may not be text at all, such as an image or a zip file, or it may use a text encoding other than UTF-8. When the bytes are not valid UTF-8, the tool shows them in hex instead.

Yes. Spaces and line breaks are removed before decoding, so Base64 copied from an email or a PEM file works as long as the header lines are left out.

Email attachments, data URLs in web pages, JSON Web Tokens, API keys and basic login headers all use Base64 to carry data as plain text.

Every 3 bytes become 4 characters. For example, 300 bytes of data become 400 Base64 characters, plus up to two = signs of padding.

References & Sources

SourceUsed ForLink
IETF RFC 4648, The Base16, Base32, and Base64 Data Encodings Base64 alphabet, padding and URL-safe variant. https://www.rfc-editor.org/rfc/rfc4648
MDN Web Docs, Base64 Base64 and UTF-8 text in browsers. https://developer.mozilla.org/en-US/docs/Glossary/Base64
Cite or share this calculator

DigitalCalculators.net. (2026, November 15). Base64 Encoder and Decoder. https://digitalcalculators.net/base64-decode/