developers.do

Base64 Encoder/Decoder

Encode text to Base64 or decode Base64 strings

Guide

About this base64 encoder/decoder

The Base64 encoder converts Unicode text to UTF-8 bytes and then represents those bytes with standard Base64 characters. The decoder reverses that process and requires the decoded bytes to be valid UTF-8 text. Processing happens locally in the browser.

How to use the base64 encoder/decoder

  1. 1.Enter ordinary text to encode, or a standard Base64 string to decode.
  2. 2.Choose Encode to Base64 or Decode from Base64.
  3. 3.Copy the result, or correct the input if the decoder reports invalid Base64 or non-UTF-8 bytes.

Important details

Base64 is not encryption

Base64 is a reversible representation for binary data. It provides no confidentiality, authenticity, hashing, or tamper protection and should never be used as a security control.

Text and Base64url differences

This page is intended for UTF-8 text and standard Base64. URL-safe Base64 commonly replaces + and / with - and _ and may omit padding, so Base64url values may require normalization before decoding here.

Frequently asked questions

Why is the Base64 output longer than the input?

Base64 represents each three bytes with four text characters, plus possible padding, so encoded data is normally about one-third larger.

Can I encode a file with this page?

This interface accepts text. It does not currently read arbitrary file bytes.

References: RFC 4648: Base-N Encodings