Base64 Encoder & Decoder

Convert text to Base64 and back, in the standard or URL-safe alphabet. Decoding recognises data URLs and binary content, so a Base64 image or PDF can be previewed or downloaded.

Mode
Variant
Advanced
Output

What Base64 is for

Base64 turns arbitrary bytes into text using 64 safe characters: A to Z, a to z, 0 to 9, plus two symbols. It exists so binary data can travel through systems that only handle text, such as email, JSON documents, HTML data URLs and HTTP headers. It is not encryption. Anyone can decode it, and it makes data about a third larger.

Standard versus URL-safe

The standard alphabet uses + and / as its two symbols and pads the output with = so its length is a multiple of four. Those three characters have special meaning in URLs, so the URL-safe variant swaps them for - and _ and usually drops the padding. JSON Web Tokens, OAuth state parameters and many APIs use the URL-safe form. This tool decodes either one and lets you pick which to produce.

Text encoding

Base64 encodes bytes, not characters, so text has to be turned into bytes first. UTF-8 is the right choice almost always and is the default here. UTF-16 and ISO-8859-1 are available for data produced by older Windows tools or legacy systems. If decoded text looks like garbage, the original was probably encoded with a different charset.

Frequently asked questions

Is Base64 secure?
No. Base64 is an encoding, not encryption. It hides nothing and anyone can reverse it. Use it to move binary data through text-only channels, never to protect secrets.
Why does my Base64 string end with one or two equals signs?
Base64 encodes three bytes as four characters. When the input length is not a multiple of three, = characters pad the last group. URL-safe Base64 often omits them, and this tool can decode with or without padding.
Can I decode a Base64 image?
Yes. Paste the Base64 or the full data URL and the tool detects common image, audio, video and document formats, shows a preview where possible, and lets you download the decoded file.
Does anything get uploaded?
No. Encoding and decoding run entirely in your browser. The page contains no analytics or third-party scripts.