By Docify

Decode Base64 to UTF-8: atob

• 5 min read

To decode Base64 to readable text, paste an RFC 4648 string and run atob, then treat the bytes as UTF-8. Docify uses decodeURIComponent(escape(atob(input))). Load sample fills ASCII Hello World! and does not run Encode or Decode. Encode writes SGVsbG8gV29ybGQh. Decode of that same string writes Hello World!. Invalid input shows an error. Download is decoded.txt, not a binary file. Nothing is uploaded.

A Base64 string is just bytes written with a 64-character alphabet. Decoding it is the reverse of encode — and only as useful as those bytes. The steps below match the live Base64 decoder. Load sample fills ASCII Hello World! and does not run Decode. Decode of SGVsbG8gV29ybGQh then writes Hello World!.

Load sample Decode leftovers

Load sample fills this ASCII string in Encode mode and does not run Encode or Decode. Encode then writes the matching RFC 4648 line. Decode of that same line writes the original text. Load sample is the text path, not FileReader.readAsDataURL.

Hello World!
SGVsbG8gV29ybGQh

How to decode Base64 in three steps

Step 1: Paste the Base64 string

Switch the tool to Decode and paste into the left-hand box. The Decode button stays disabled until that box has text. Load sample fills ASCII Hello World! in Encode mode and does not run Encode or Decode. Encode of that leftover writes SGVsbG8gV29ybGQh. Whitespace-only strings still count as input; a bad alphabet fails on click.

SGVsbG8gV29ybGQh

Step 2: Click Decode

Open the Docify Base64 tool and click Decode. The page runs decodeURIComponent(escape(atob(input))). Load sample Decode leftovers: SGVsbG8gV29ybGQh writes Hello World!. atob rejects characters outside the standard alphabet. The work stays in the browser.

Step 3: Read the UTF-8 text

Copy writes the output to the clipboard. Download saves it as decoded.txt (text/plain). Load sample Decode of SGVsbG8gV29ybGQh writes ASCII Hello World!:

Hello World!

What decode will and will not do

Invalid strings

Any thrown error is shown as Failed to decode: Invalid Base64 string and the output box is cleared. Typical causes: missing padding, base64url - / _, or bytes that are not valid UTF-8 after atob.

Upload on Decode

Upload file still uses FileReader.readAsDataURL and takes the payload after the comma. On Decode that payload is written into the input box. You still click Decode, which treats those bytes as UTF-8 text — not as a restored image or PDF. See Convert a file to Base64 (FileReader) for the encode-side path.

Not email or JWT tooling

The page does not parse MIME parts, extract attachments, or split a three-segment JWT. Those formats often use different wrapping or base64url. Decode only the payload you paste.

Decode Base64 in the browser

Load sample Decode writes SGVsbG8gV29ybGQh Hello World!. Load sample does not run Decode. RFC 4648, not a binary restore. Nothing is uploaded.

Use Base64 Decoder →

FAQ

What does Load sample Decode write on the live Base64 page?
Load sample fills ASCII Hello World! (Encode mode) and does not run Encode or Decode. Encode then writes SGVsbG8gV29ybGQh. Decode of that same string writes Hello World!. Load sample is the text path, not FileReader.readAsDataURL. The alphabet is RFC 4648 Base64 (+, /, = padding), not base64url. Download is decoded.txt as text/plain, not a binary restore.
Does Docify upload the Base64 I paste?
No. Decode, copy, and download run in your browser. Load sample, Encode, and Decode stay on the page. The page does not send the string to a server.
How does Docify decode Base64 to text?
Decode runs decodeURIComponent(escape(atob(input))). atob reads standard RFC 4648 Base64 (+, /, = padding). The escape / decodeURIComponent pair treats the bytes as UTF-8. Load sample fills ASCII Hello World! and does not run Decode. Decode of SGVsbG8gV29ybGQh writes Hello World!. A malformed string shows “Failed to decode: Invalid Base64 string”.
Can decode restore an image, PDF, or email attachment?
No. Download always writes decoded.txt as text/plain. Bytes that are not valid UTF-8 fail or look like garbage. There is no MIME unpacker and no typed binary save.
Does this decode JWTs?
No. JWT segments use base64url (-, _, often no padding). This page uses standard Base64 and then UTF-8 text decode. It does not split a token, verify a signature, or claim a token is valid.

Related