Advertisement
Developer Tools

Base64 Decode and Encode

Paste Base64 to decode it to text, or to an image, PDF or file you can preview and download. Encode text and files to Base64, Base64URL or data URIs, line by line or as one block. Data URIs, missing padding and URL-safe input are handled automatically.

  • Base64 to image and PDF
  • Hex and hex dump output
  • Image to data URI
  • Base64URL and no padding
  • Bulk, line by line
Result
Your result appears here.
Images, PDFs and other files get a preview and a download button.
Decode auto-detects Base64URL, data URIs and missing padding.
Advertisement
How to use

How to use the Base64 decoder

  1. 1

    Pick decode or encode

    Base64 decode turns Base64 back into text or a file. Encode turns text into Base64. File to Base64 converts an upload.

  2. 2

    Paste or upload

    Paste a Base64 string or full data: URI, or text to encode. For files, choose up to 3 MB.

  3. 3

    Choose options

    Pick text, hex or hex dump output, a character set, URL-safe output, padding and line wrapping.

  4. 4

    Copy or download

    Copy the result, or preview and download decoded images, PDFs and other files.

Base64 decode online

How to decode Base64

Base64 represents binary data using only 64 safe characters: A-Z, a-z, 0-9, + and /, with = as padding. Every 3 bytes of data become 4 characters, so Base64 is about 33% larger than the original. It is how email attachments, JSON Web Tokens, API payloads, Kubernetes secrets and inline images carry bytes through systems that only accept text.

To decode Base64 online, paste the string and click Convert. The decoder is strict: it only accepts valid Base64 characters and tells you if the length is impossible, instead of quietly returning garbage. It also accepts the common variations so you do not need to clean the input first:

  • A full data URI such as data:image/png;base64,iVBORw0.... The prefix is stripped and the declared type is used.
  • Base64URL (with - and _ instead of + and /), used in JWTs and URLs.
  • Missing = padding, line breaks and spaces from MIME email bodies.

Need to decode many values? Tick Each line separately and every line is decoded on its own.

Base64 to image and PDF

Decode Base64 to an image, PDF or file

When the decoded bytes are not text, the tool detects the real file type from its contents (the "magic bytes"), not from a guess. If it is an image, you get a Base64 to image preview straight away, with a download button for the file. PNG, JPEG, GIF, WebP, SVG, ICO and AVIF are recognised.

The same works for Base64 to PDF: paste the string from an API response or an email source and download decoded.pdf. ZIP archives, Word and Excel documents, fonts, audio and other files are detected too, with the right file extension.

Base64 to hex

For low-level debugging choose Hex string for one continuous run of hexadecimal bytes, or Hex dump for the classic three-column view with byte offset, hex pairs and printable ASCII. That is the quickest way to inspect a binary token, a hash stored as Base64 or the header of an unknown file.

Text encodings

Base64 encodes bytes, not letters. If decoded text shows strange characters like é, the original was probably not UTF-8. Switch Text character set to Windows-1252 (Latin-1) or UTF-16. The same setting applies when encoding, which matters for systems such as PowerShell -EncodedCommand that expect UTF-16LE.

Advertisement
Base64 encode

Encode text and images to Base64

The Base64 encode tab converts text to Base64. Options cover every common variant:

  • URL-safe (Base64URL) replaces + and / so the result can go in a URL or file name without percent-encoding.
  • No padding removes trailing =, as required by JWT and many APIs.
  • Wrap at 76 characters produces MIME-compatible line lengths for email.

The File or image to Base64 tab turns an upload into a data URI, plain Base64, a CSS background-image rule or a ready <img> tag. Inlining small icons and logos this way saves an HTTP request. For anything larger than a few kilobytes, a normal image file is usually faster because browsers can cache it separately.

Good to know

Base64 is encoding, not encryption

Anyone can decode Base64, so it gives no protection at all. Never treat a Base64 value as hidden: API keys, passwords and personal data inside Base64 strings, Basic Auth headers or JWT payloads are fully readable. Use proper encryption or a hash when you need security.

Base64 also is not compression. The output is always about a third larger than the input, plus line breaks if you wrap it.

Working with URLs instead? Percent-encoding is a different scheme, handled by the URL decode and encode tool. To read a decoded JSON payload, paste it into the JSON formatter.

FAQ

Base64 Decode & Encode: frequently asked questions

How do I decode Base64?

Paste the Base64 string into the Base64 decode tab and click Convert. Text is shown directly. Images, PDFs and other files are detected automatically with a preview and a download button.

How do I convert Base64 to an image?

Paste the Base64 string, with or without the data:image/...;base64, prefix, and click Convert. The decoder detects PNG, JPEG, GIF, WebP, SVG and other formats, shows the image and lets you download it.

Can I decode Base64 to PDF?

Yes. Paste the Base64 that represents the PDF and click Convert. The tool detects application/pdf and offers decoded.pdf for download.

How do I convert an image to Base64?

Open File or image to Base64, upload the image and choose Data URI, plain Base64, CSS or an HTML img tag as the output.

What is Base64URL?

Base64URL is a variant that uses - and _ instead of + and /, and usually drops the = padding, so it is safe in URLs and file names. JWTs use it. The decoder accepts both variants automatically.

Why does my decoded text have strange characters?

The original text was probably in a different character set. Change Text character set to Windows-1252 or UTF-16 and convert again.

Is Base64 encryption?

No. Base64 is a reversible encoding that anyone can decode. It does not protect data.

Is there a size limit?

You can paste up to 4 MB of text, and upload files up to 3 MB for encoding. Nothing is stored after the result is shown.

About Developer Tools

More about our developer tools

Everyday developer utilities for working with JSON, CSV, Base64, URL encoding, hashes and UUIDs. Every tool runs the conversion on our server with PHP's own standard functions, json_decode, base64_encode, hash(), random_bytes, so the output matches what your own code would produce.

Why server-side developer tools?

Many online formatters run a JavaScript library in your browser that behaves slightly differently from the language you actually deploy. BulkMaker runs PHP's native implementations, which follow the same RFCs (RFC 8259 for JSON, RFC 4648 for Base64, RFC 3986 for URL encoding, RFC 4122 for UUIDs) that every mainstream language implements.

Bulk by default

Each developer tool accepts many values at once, one per line, so you can hash a column of IDs, decode a list of Base64 strings, or generate 500 UUIDs in one go instead of pasting them one at a time.

Privacy and secrets

Input is processed in memory for a single request and never written to disk or a database. Even so, avoid pasting production secrets, private keys or live passwords into any online tool, rotate any credential that has been pasted somewhere you do not control.