Base64 Decoder & Encoder

Decode and encode Base64 and base64url, turn files into data URIs and look inside binary data.

Input
Output
Runs locally · nothing is uploaded

Online Base64 decoder and encoder

Paste Base64 and get back the text, or a hex dump and a preview when it holds binary data such as an image. Or encode text and files, including images as data URIs ready for HTML and CSS. Both the standard alphabet and URL-safe base64url are supported, and wrapped Base64 copied out of PEM files or emails decodes as it is.

Features

How to decode Base64

  1. Choose Decode and paste Base64 or a data URI into Input, or open a .b64 or .pem file.
  2. The decoded text appears in Output as you type. Binary data shows as a hex dump, with a preview for images.
  3. Click Copy, or press Ctrl/⌘ + Shift + C, or Download to save the bytes as a file.
  4. Press Ctrl/⌘ + Enter to switch between Decode and Encode, and f to maximize Output.

Standard or URL-safe?

InputStandardURL-safe, no padding
helloaGVsbG8=aGVsbG8
<<??>>PDw/Pz4+PDw_Pz4-
caféY2Fmw6k=Y2Fmw6k

Use Standard for email, PEM files, data URIs and most APIs. Use URL-safe for values that go into a URL, a file name or a JWT.

Frequently asked questions

What is Base64?

Base64 is a way to write any bytes, such as text, images or other binary data, using only 64 safe characters: A–Z, a–z, 0–9, + and /. Every 3 bytes become 4 characters, so Base64 is about a third larger than the original. It is used in email attachments, data URIs, JSON payloads, JWTs and HTTP Basic authentication.

What is URL-safe Base64 (base64url)?

base64url replaces + with - and / with _ so the result can go in a URL or file name without escaping, and usually leaves out the = padding. JWTs use it. The decoder accepts both alphabets, with or without padding, automatically.

Why does the decoded output show hex instead of text?

The decoded bytes are not valid UTF-8 text, so they are probably binary data such as an image, a compressed file or protobuf. The output shows a hex dump of the first 64 KB instead. Use Download to save all of the bytes as a file.

How do I convert an image to Base64 or a data URI?

Choose Encode, then click Open file or drop the image on the Input. Turn on Data URI to get a data:image/png;base64,… string you can paste into HTML or CSS.

How do I convert Base64 back to an image or file?

Choose Decode and paste the Base64 or data URI. Images are previewed, and Download saves the decoded bytes with a file extension picked from the data URI or the file's first bytes.

Is my data safe?

Yes. Decoding and encoding run in your browser. Nothing you paste or open is sent to a server or stored. Files you open are read on your own device and are never uploaded.