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
- Base64 decode to UTF-8 text. Binary data is shown as a hex dump instead, and images get a preview.
- Base64 encode text as UTF-8, or any file up to 10 MB.
- Standard or URL-safe: encode with
+/or-_(base64url, as in JWTs); decode accepts both automatically. - Padding and wrapping: leave out the
=padding, or split lines at 64 (PEM) or 76 (MIME) characters. - Data URIs: encode a file as
data:image/png;base64,…, and paste a data URI to decode it. - Download decoded bytes as a file, named from the data URI or the file's first bytes (PNG, JPEG, GIF, WebP, PDF, ZIP, gzip).
- Precise errors: an invalid character or wrong padding is highlighted in the input, with its line and column.
- Private by design: no uploads, no tracking, nothing stored.
How to decode Base64
- Choose Decode and paste Base64 or a data URI into Input, or open a
.b64or.pemfile. - The decoded text appears in Output as you type. Binary data shows as a hex dump, with a preview for images.
- Click Copy, or press Ctrl/⌘ + Shift + C, or Download to save the bytes as a file.
- Press Ctrl/⌘ + Enter to switch between Decode and Encode, and f to maximize Output.
Standard or URL-safe?
| Input | Standard | URL-safe, no padding |
|---|---|---|
hello | aGVsbG8= | 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.