Guide

How to Encode and Decode Base64

A step-by-step way to encode bytes to Base64 text and decode them back.

Base64 turns arbitrary bytes into a text-safe alphabet so they survive systems that only carry text. Encoding and decoding are exact inverses.

01Steps

  • Start from the exact bytes or UTF-8 text you want to carry.
  • Choose standard or URL-safe Base64 for the destination.
  • Encode and copy the value without wrapping or stripping characters.
  • Decode with the same alphabet and verify the bytes match.

Sources

  1. RFC 4648: The Base16, Base32, and Base64 Data Encodings — IETF (accessed 2026-09-01)