DNS RobotDNS Propagation Checker
HomeDNS LookupWHOIS LookupIP LookupSSL Check
DNS RobotDNS Propagation Checker

Next-generation DNS propagation toolkit

Privacy PolicyTerms of ServiceAbout UsBlogContact

DNS Tools

DNS LookupDNS Speed TestDomain to IPNS LookupMX LookupView all

Email Tools

Email CheckerSPF Record CheckerDMARC CheckerDKIM CheckerSMTP Test ToolView all

Website Tools

Website Down CheckerWHOIS LookupHosting CheckerDomain AvailabilitySubdomain FinderView all

Network Tools

Ping ToolTraceroutePort CheckerHTTP Headers CheckSSL Certificate CheckView all

IP Tools

IP LookupWhat Is My IPRouter LoginIP Blacklist CheckIP to HostnameView all

Utility Tools

QR Code ScannerQR Code GeneratorUPI QR Code GeneratorWiFi QR Code GeneratorMorse Code TranslatorView all
© 2026 DNS Robot. Developed by ❤ Shaik Brothers
All systems operational
Made with
  1. Home
  2. /
  3. Text Tools
  4. /
  5. Base64

Base64 Decode and Encode Online

Decode Base64 to text, images or PDF, and encode text or any file to Base64 or a data URI. Handles UTF-8, URL-safe Base64 and data: prefixes, and everything runs in your browser.

Base64 DecodeBase64 EncodeBase64 to Image & PDFURL-Safe

Everything runs in your browser. Nothing you paste or upload is sent to our server.

Advertisement

What Is Base64?

Base64 is a way to write any data, whether text, images or whole files, using only 64 safe characters: A–Z, a–z, 0–9, + and /, with = as padding at the end (defined in RFC 4648). It exists so binary data can travel through systems built for plain text, such as email, JSON, HTML and HTTP headers.

Every 3 bytes of input become 4 Base64 characters, so encoded data is about 33% larger than the original. For example, the text Hi becomes SGk=. You meet Base64 in email attachments, data: image URIs in HTML and CSS, API responses that carry files, JSON Web Tokens and HTTP Basic authentication headers.

Base64 decoder turning a Base64 string into readable text, with Decode, Encode and File to Base64 tabs
Paste Base64 to decode it instantly; switch tabs to encode text or a whole file.

How to Decode Base64

1
Paste the Base64

Paste it into the Decode box. Line breaks, spaces, a data:...;base64, prefix, URL-safe characters (- and _) and missing = padding are all handled.

2
Read the result

If the data is text, the decoded UTF-8 text appears straight away, ready to copy.

3
Get files back

If the data is a file, the decoder recognises the format from its first bytes: images are previewed and PDFs, ZIPs and other files can be downloaded.

Advertisement

How to Encode Text or a File to Base64

1
Encode text

Type or paste text in the Encode tab. It is encoded as UTF-8, so accents, Asian scripts and emoji round-trip correctly.

2
Pick a variant

Tick URL-safe for Base64URL (used in URLs and JWTs), or wrap at 76 characters for MIME email bodies.

3
Encode a file

In File to Base64, drop any file up to 10 MB. Copy the raw Base64 or a ready-made data URI such as data:image/png;base64,... to embed it in HTML or CSS.

Base64 to Image and Base64 to PDF

Base64 often wraps a file: an image embedded in a web page or email, or a PDF returned by an API. The decoder checks the first bytes, known as magic numbers, to tell what the file is: PNG, JPEG, GIF, WebP and SVG images get a live preview, and PDF, ZIP, GZIP, MP3 and MP4 files get a download button. PDFs can also be opened in a new tab.

Going the other way, image to Base64 works in the File to Base64 tab: drop the image and copy the data URI.

Advertisement

Base64 Variants: Standard, URL-Safe, MIME and Data URIs

RFC 4648Standard Base64

Uses + and / with = padding. The default in most libraries and APIs.

URL-safeBase64URL

Swaps + and / for - and _ and usually drops the padding, so the result can sit in a URL or file name. JSON Web Tokens use it.

EmailMIME Base64

Standard Base64 broken into lines of 76 characters, as used for email attachments.

HTML & CSSData URI

Base64 with a prefix that names the file type, such as data:image/png;base64,, so a browser can display it inline.

Base64 Is Encoding, Not Encryption

Base64 makes data safe to transport, not secret. Anyone can decode it in a second, including with this tool:

  • Never use Base64 to hide passwords or keys. An HTTP Basic authentication header is just user:password in Base64, which is why it must only travel over HTTPS. Check a site's certificate with the SSL checker.

  • JWT payloads are readable. The middle part of a JSON Web Token is Base64URL-encoded JSON, so anyone holding a token can read its claims.

  • Decoding here is private. This tool runs entirely in your browser; the data you paste or upload never reaches our server.

  • Need real secrecy? Use proper encryption, and generate strong secrets with the password generator.

Advertisement

Base64 in JavaScript, Python and the Command Line

Every language has Base64 built in. Remember to encode text as UTF-8 first, or non-English characters break.

JavaScript (browser)
// Encode UTF-8 text const b64 = btoa(String.fromCharCode(...new TextEncoder().encode('héllo'))) // 'aMOpbGxv' // Decode back to text const text = new TextDecoder().decode(Uint8Array.from(atob(b64), (c) => c.charCodeAt(0)))
Python
import base64 b64 = base64.b64encode('héllo'.encode()).decode() # 'aMOpbGxv' text = base64.b64decode(b64).decode() # 'héllo' url_safe = base64.urlsafe_b64encode(b'\xfb\xff\xbf') # b'-_-_'
Linux / macOS terminal
echo -n 'hello' | base64 # aGVsbG8= echo 'aGVsbG8=' | base64 --decode # hello base64 -w 0 image.png > image.txt # Linux: one line, no wrapping
PowerShell
[Convert]::ToBase64String([Text.Encoding]::UTF8.GetBytes('hello')) # aGVsbG8= [Text.Encoding]::UTF8.GetString([Convert]::FromBase64String('aGVsbG8=')) # hello

More Encoding and Text Tools

Other converters for working with text and data:

Binary Translator

Text to binary and back, with hex, decimal and octal.

Invisible Character

Find and remove hidden zero-width characters.

HTTP Headers

See the headers a server returns, including encoded ones.

Password Generator

Create strong random passwords and secrets.

Base64 FAQ

Paste the Base64 string into the Decode box above. Text is decoded as UTF-8 instantly; if the data is a file, its type is detected and you can preview or download it.

Advertisement