Base64 Encoder and Decoder

Encode Unicode text as UTF-8 bytes and convert those bytes to standard or URL-safe Base64, or decode Base64 back to strict UTF-8 text.

Base64 is an encoding, not encryption.

Your text is processed in this browser and is not submitted to UnicodeNow.

Processed locally in your browser

Encode Unicode text as UTF-8 bytes and then Base64, or decode standard or URL-safe Base64 bytes back to strict UTF-8 text. Base64 is byte-oriented. Valid Base64 can contain binary data that is not valid UTF-8 text.

Base64 is encoding, not encryption. Anyone with the encoded value can decode it.

Operation

Standard uses + and /; URL-safe uses - and _.

Advanced options

Normalization changes the Unicode sequence before UTF-8 encoding and therefore changes the resulting Base64.

Paste Unicode text for encoding, or Base64 text for decoding. Input remains local to this browser.

What this Base64 tool does

This tool converts Unicode text to Base64 by using the correct text pipeline: Unicode string to UTF-8 bytes to Base64. It also decodes Base64 text back to bytes, then either interprets those bytes as strict UTF-8 text or shows the decoded bytes as hexadecimal. The reverse pipeline is Base64 to bytes to UTF-8 text. Processing runs locally in your browser.

Base64 is byte-oriented. It can represent text, images, compressed files, keys, tokens or arbitrary binary payloads. This page is primarily a text and byte-inspection tool, so invalid UTF-8 is reported separately from invalid Base64 instead of being silently replaced.

Base64 example

Input text:
Hello, café 😀

Standard Base64:
SGVsbG8sIGNhZsOpIPCfmIA=

Standard vs URL-safe Base64

FeatureStandard Base64URL-safe Base64
Character 62+-
Character 63/_
PaddingUsually =Often optional by protocol
Common usesGeneral data, MIMEURLs, filenames, JWT segments

URL-safe Base64 avoids characters that are awkward in URLs and filenames, but it is not automatically safe for every protocol. You still need to consider the surrounding syntax, separators, quoting rules and whether padding is allowed.

Base64 works with bytes, not characters

é
Unicode code point: U+00E9
UTF-8 bytes: C3 A9
Base64: w6k=

Direct btoa("é")-style handling is unreliable because btoa() expects byte-like character values, not arbitrary Unicode text. This tool uses TextEncoder before encoding, so emoji, combining marks and non-Latin text are converted through UTF-8 bytes first.

Base64 padding

Base64 processes bytes in groups of three and emits four encoded symbols. If the final byte group is short, = padding marks the missing bytes. Valid padding has zero, one or two equals signs at the end. An encoded length of one modulo four is impossible. Some protocols omit padding, so this decoder can infer valid missing padding and report when it did so.

Base64 is not encryption

Base64 only changes representation. It does not hide, protect, sign, encrypt, compress or sanitize the data. Anyone with the encoded value can decode it. Do not use Base64 as a security boundary.

Invalid Base64

Invalid input can come from the wrong alphabet, mixed standard and URL-safe characters, impossible lengths, misplaced padding, too much padding or unexpected punctuation. This tool can ignore only ASCII spaces, tabs, line feeds and carriage returns. It does not silently remove non-breaking spaces, zero-width spaces or other Unicode whitespace because those characters may indicate copied-text corruption.

Binary data vs UTF-8 text

Valid Base64 may decode to a PNG, PDF, ZIP file or any other byte sequence. Those bytes are not necessarily UTF-8. In UTF-8 text mode, invalid bytes cause a clear error. Hex bytes mode shows the decoded bytes such as 48 65 6C 6C 6F without assuming a character encoding.

Data URLs

SGVsbG8= is plain Base64. data:text/plain;base64,SGVsbG8= is a Data URL with a media type and prefix. The decoder rejects prefixes by default. If you intentionally enable prefix stripping, it accepts only a valid Base64 Data URL pattern and reports the removed media type.

How to use the tool

  1. Choose Encode or Decode.
  2. For Encode, choose Standard or URL-safe Base64 and whether to include padding.
  3. For Decode, choose Auto-detect or a specific variant.
  4. Choose padding and whitespace handling.
  5. Select UTF-8 text or Hex bytes for decoded output.
  6. Use Advanced options only when you intentionally need normalization before encoding or Data URL prefix stripping.
  7. Review warnings and statistics before copying, downloading or using output as input.

Privacy and processing

This tool runs in your browser. Your input is not submitted to UnicodeNow. The local runner writes output as textarea text and uses Blob URLs only for downloads.

Common uses

Frequently asked questions

What is Base64?

Base64 is a text representation of binary bytes using a limited ASCII alphabet.

Is Base64 encryption?

No. Base64 only changes representation and provides no confidentiality.

What is the difference between standard and URL-safe Base64?

Standard Base64 uses + and /, while URL-safe Base64 uses - and _.

Why does Base64 end with =?

The equals sign pads the final encoded group when the byte count is not divisible by three.

Can Base64 omit padding?

Some protocols allow omitted padding, but the decoder must infer only valid missing padding.

Can Base64 contain line breaks?

MIME Base64 often does. This tool can ignore ASCII spaces, tabs, line feeds and carriage returns when enabled.

Why can valid Base64 fail to decode as UTF-8?

Base64 represents bytes, and those bytes may be binary data or text in another encoding.

Does Base64 support emoji?

Yes, when emoji are first encoded as UTF-8 bytes.

Why does btoa() fail with Unicode text?

btoa() expects byte-like character values rather than arbitrary Unicode text.

Can I decode JWT segments with this tool?

It can decode URL-safe Base64 text segments, but it does not verify signatures or claims.

Can this tool decode files?

This page is primarily for text and byte inspection. It does not provide a full file-decoding workflow.

Does Base64 make data smaller?

No. Base64 normally increases size.

Is my text uploaded?

No. This tool runs in your browser and does not submit input to UnicodeNow.

Related tools

Byte Length Calculator

Count UTF-8 bytes, code points, grapheme clusters and UTF-16 code units for text.

EncodingProcessed locally

Hex to Text

Decode hexadecimal byte values into UTF-8 text.

EncodingProcessed locally

Text to Hex

Convert UTF-8 text bytes into hexadecimal values.

EncodingProcessed locally

Binary to Text

Decode binary byte groups into UTF-8 text.

EncodingProcessed locally

Text to Binary

Convert UTF-8 text bytes into binary byte groups.

EncodingProcessed locally

Decimal to Text

Convert decimal bytes or Unicode code point values to text.

EncodingProcessed locally

URL Encoder and Decoder

Encode and decode URL components, full URLs and form-style strings.

EncodingProcessed locally

Unicode Character Inspector

Inspect each Unicode character, encoding, category, script and normalization form.

UnicodeProcessed locally

Related guides

Unicode vs UTF-8

Unicode defines characters and code points. UTF-8 encodes those code points as bytes for files, databases, web pages, APIs and network messages.