Base64 decode and encode

Paste Base64 and see it decoded as you type. The decoder accepts standard and URL-safe Base64, with or without = padding, with line breaks or as a full data: URI. Text is shown in the right character set, JSON is pretty-printed, and if the Base64 holds a file such as a PNG, JPEG, PDF or MP3 you get a preview and a download with the right extension. Switch to Encode to turn text or any file into Base64, with options for URL-safe output, no padding, 76-character lines and data URIs. Everything runs in your browser, so tokens and private data never leave your device.

Free · No sign-up

Mode

Result
Show as

Paste Base64 to decode it.


      

How to use it

  1. Paste Base64 into the box, or open a .txt file that contains it.
  2. Read the decoded text, or preview and download the file it contains.
  3. If letters look wrong, choose another character set.
  4. To encode, switch to Encode and type text or open any file.

Why use this tool

Forgiving decoder

Standard and URL-safe Base64, missing padding, line breaks and data: URIs all work.

Any character set

UTF-8 is detected automatically; Shift_JIS, GBK, Big5, Windows-1251 and more are one click away.

Files and previews

Recognises PNG, JPEG, GIF, WebP, SVG, PDF, ZIP, MP3, MP4 and more, with a preview and the right file extension.

Hex view

See the raw bytes of binary data or check for hidden characters.

Encode text or files

URL-safe output, no padding, 76-character MIME lines and data URI prefix.

Private

Decoding runs in your browser, so API keys and tokens are not sent anywhere.

What is Base64?

Base64 writes any bytes using only 64 safe characters: A–Z, a–z, 0–9, + and /. It is used wherever binary data has to travel through systems built for text, such as email attachments, JSON APIs, data URIs in HTML and CSS, Basic authentication headers and JSON Web Tokens. Every 3 bytes become 4 characters, so Base64 is about a third larger than the original.

URL-safe Base64 and padding

URL-safe Base64 replaces + with - and / with _ so the result can go into a URL or file name. It is common in JWTs and signed links, and the = padding at the end is often left out. This decoder handles both automatically. When encoding, tick URL-safe and No = padding to match what an API expects.

Decoding images and files from Base64

Paste a data:image/png;base64 string from CSS or HTML, or Base64 copied from an API response, and the tool recognises the file by its first bytes. Images, audio and video are previewed, PDFs open in a new tab, and Download saves the file with the correct extension.

Common Base64 problems

  • Strange characters like é mean the text is UTF-8 shown as another charset, or the other way round. Change the character set.
  • "Character is not used by Base64" usually means stray quotes, a backslash or an escaped \n from JSON.
  • A wrong length often means the string was cut off when copying.
  • Base64 is encoding, not encryption: anyone can decode it, so never use it to hide passwords.

Frequently asked questions

How do I decode Base64?

Paste the Base64 into the box. The decoded text or file appears right away; there is no button to press.

Is my data uploaded?

No. Decoding and encoding happen in your browser, which matters for tokens, keys and personal data.

Why does the decoded text look garbled?

The text may use another character set. Pick it in the list, for example Shift_JIS for older Japanese text or Windows-1251 for older Russian text.

Can I convert Base64 to an image?

Yes. Paste the Base64 or the whole data URI and the image is shown. Press Download to save it as PNG, JPEG or the right format.

How do I encode a file to Base64?

Switch to Encode, press Open file and choose the file. Tick Add data: URI prefix if you want to embed it in HTML or CSS.

Is Base64 encryption?

No. Base64 only changes how data is written. Anyone can decode it, so it does not protect secrets.

Related tools

Need something built?

Tell us what you want to create.

Tell us what you need built, from a simple website to a complete app, AI solution, automation, or custom system.

Tell us what you want to build. We review every enquiry and reply by email.

Contact

Thanks, your enquiry is on its way.

We will review the details and reply by email.