What is Base64? Encoding explained (with examples)

Base64 is an encoding that turns binary data (bytes) into text using a limited alphabet. It’s commonly used to embed images (data URIs), send binary safely in JSON, or move data through systems that expect text.

What Base64 is (and isn’t)

Common use cases

Standard Base64 vs Base64url

Base64url is a URL-safe variant used by JWTs. It swaps characters like + and / for - and _ to avoid URL escaping.

Read the full breakdown: Base64url vs Base64 .

Examples

Encode plain text

Input:  hello
Output: aGVsbG8=

Decode a Base64 string

Input:  eyJmb28iOiJiYXIifQ==
    Output: {"foo":"bar"}

Try it instantly

Use the tool page to encode/decode text, images, JSON, and files: Base64 Encoder & Decoder .

Related