Base64 Decode and Encode

Paste Base64 to decode it to text, an image or a file, or pick Encode to turn text and files into Base64 as you type.

Convert
DecodeEncode

Base64 to text or a file

Alphabet
StandardURL safe

Both are read when decoding

Base64

Paste Base64, drop a file or open one to start.

The decoded text shows here as you paste, ready to copy or download.

Decode Base64 online to readable text, hex bytes or the original file, and encode text or any file back to Base64.

Free with no sign-up and no limit, for tokens, email attachments, API responses and images in HTML or CSS.

  • Shows images and PDFs inside Base64
  • Standard and URL safe Base64
  • UTF-8 text, emoji included

How to decode Base64

Decode a Base64 string, look inside it and encode new text in three steps.

  1. Paste Base64 to decode

    Paste a Base64 string or a data URI into the left box, or open a .txt file. The decoded text shows on the right.

  2. View as text or a file

    Switch between Text, Hex and File. A picture or PDF inside the Base64 shows in File, ready to save to your device.

  3. Encode text to Base64

    Pick Encode, then type text or open any file to get its Base64. Copy it, download it, or turn on URL safe for links.

How Base64 encoding works

Base64 writes any data with 64 safe characters: A to Z, a to z, 0 to 9, plus + and /. Every 3 bytes become 4 characters, so the text is about a third longer than the file, but it survives email, JSON, URLs and HTML untouched.

When the data does not split evenly into 3 byte groups, the end is padded with one or two = signs. The decoder here adds missing padding for you, skips spaces and line breaks, and names the line and column of any character that does not belong.

URL safe Base64, also called base64url, swaps + and / for - and _ and drops the padding, so the string can sit in a web address or a file name. JSON Web Tokens use it. Both kinds decode here without changing a setting.

Convert Base64 to an image or PDF

Base64 often hides a whole file: a logo in an HTML page, a PDF in an API response, an attachment in an email. The decoder reads the first bytes, names the type, such as PNG, JPG, GIF, WebP, SVG or PDF, and shows the picture in the File tab.

Download saves the file with the right ending, so base64 to PDF or base64 to PNG takes one click. A data URI such as data:image/png;base64, works too: the prefix is read for the type and removed before decoding.

Going the other way, open any image or file in Encode to get its Base64. The Data URI tab writes it ready to paste into an img src or a CSS background, so a small icon needs no separate file.

Base64 converter features

  • Base64 to text

    Decodes to UTF-8, so accents, Chinese, Arabic and emoji come out as written, not as broken symbols.

  • Base64 to hex

    See the decoded bytes as hex pairs, useful for keys, hashes and binary data that is not text at all.

  • Image to Base64

    Open a PNG, JPG, SVG or any picture to get its Base64 and a data URI ready for HTML, CSS or JSON.

  • Base64 to PDF

    Paste Base64 from an API or an email and save the PDF inside it, with pages and fonts unchanged.

  • URL safe Base64

    Encode with - and _ and no padding for links, tokens and file names. Decoding reads both alphabets.

  • Base64 validator

    A character that does not belong is named with its line and column, so a broken copy is easy to fix.

Is this Base64 decoder safe?

Every string and file is decoded on your device. Nothing is sent to a server or saved to a link.

  • Processing

    Decoding, encoding and file previews run in your browser. Your tokens and files never go online.

  • Storage

    Only the text you type is remembered, in this browser, for your next visit. Files are never kept.

  • Account

    A free Base64 decoder and encoder with no sign-up, no email and no limit on how often you use it.

Common Base64 questions

What is Base64 encoding?

A way to write any data, even images and files, as plain text using 64 characters, so it passes safely through email and code.

Is Base64 encryption?

No. Base64 has no key, so anyone can decode it in a second. Never use it to hide passwords; use real encryption for that.

How do I decode Base64 in Linux?

Run echo 'SGVsbG8=' | base64 --decode in a terminal, or base64 -d file.txt for a file. On a Mac, base64 -D works too.

How do I decode Base64 in Python?

Import base64, then call base64.b64decode(text). Add .decode('utf-8') to get a string instead of bytes.

How do I decode Base64 in JavaScript?

Call atob(text) for plain ASCII. For accents and emoji, read the bytes with Uint8Array.fromBase64(text), then TextDecoder.

Why does Base64 end with = or ==?

The = signs are padding. They fill the last group of 4 characters when the data is 1 or 2 bytes short of a full 3 byte group.

How do I convert Base64 to an image?

Paste the Base64 above and open the File tab. The picture shows there, and Download saves it as a PNG, JPG or GIF file.

What characters are used in Base64?

A to Z, a to z, 0 to 9, + and /, with = for padding. URL safe Base64 uses - and _ in place of + and /.

Still stuck, or found a problem? Email dobliquestudio@gmail.com and we will help.