Developer Tools

Base64 Encoder & Decoder

Turn text into a portable ASCII representation, or inspect the bytes behind a Base64 string. Choose standard Base64 or the URL-safe alphabet, then choose text or hexadecimal output so binary data is never mistaken for broken text.

Free online tool

Loading tool…

18 decoded byte(s)
24 encoded character(s)

UTF-8 text and raw bytes are distinct. Decode to hex for images or other binary data. Strict canonical validation catches incorrect padding and unused bits. Input limit: 250,000 UTF-16 code units. Base64 provides no secrecy.

Conversions run locally in your browser. This tool does not upload input or save it to browser storage.

GET STARTED

How to use the Base64 Encoder & Decoder

  1. 01

    Choose encode or decode and select the alphabet used by your system.

  2. 02

    For encoding, enter UTF-8 text or pairs of hexadecimal digits. Base64url can include or omit padding.

  3. 03

    For decoding, choose text for valid UTF-8 or hex for arbitrary bytes. Enable whitespace removal only when needed for wrapped input.

  4. 04

    Copy or download the result. Reverse the direction to check the same bytes.

Examples

A short word

The UTF-8 bytes for Hello encode as SGVsbG8=. The final equals sign fills the last four-symbol group.

A binary byte

Hex FF encodes as /w== in standard Base64 and _w== in Base64url. Decoding this byte as UTF-8 fails correctly; hex output remains ff.

Text goes through bytes first

A Base64 symbol carries six bits. The input to this process is a sequence of bytes, so non-ASCII text first becomes UTF-8. A waving-hand emoji takes four bytes, rather than one byte per displayed character.

Use the right alphabet and padding

The standard alphabet uses plus and slash. Base64url substitutes minus and underscore. This decoder accepts omitted Base64url padding, requires correct standard padding, and rejects mixed alphabets and nonzero unused bits.

Encoding does not protect a secret

Anyone with the encoded string can recover its bytes. Base64 is useful for transport, debugging, and protocol compatibility; it is not encryption or a password storage method.

What to know

  • 250,000 UTF-16 code units per input.
  • Text decoding supports UTF-8 only. Use hexadecimal for arbitrary binary bytes.

Common questions

Why can I decode to hex but not text?

Base64 can represent any bytes. Some byte sequences are not valid UTF-8, including most image or archive contents. Hex preserves those bytes without substituting replacement characters.

Does decoding ignore spaces?

Only when you enable the whitespace option. It removes ASCII spaces, tabs, form feeds, and line endings; it does not silently remove other symbols.

Are leading Unicode byte-order marks preserved?

Yes. Text decoding preserves a UTF-8 BOM as U+FEFF so a text round trip does not silently lose that code point.

Sources & references