Free 🔐 Base64 Encoder & Decoder

Person working on a laptop at home
Photo: Shixart1985 / Wikimedia Commons, CC BY 2.0

Encode text & files to Base64 or decode Base64 back — with URL-safe mode, file downloads and an image-to-data-URI maker. 100% private, right in your browser.

or
Result will appear here…

📝 When do developers use Base64?

🔑 JWT & API tokens

JWT headers and payloads are Base64URL — paste a token to inspect its claims.

🖼️ Data URIs

Embed small images or fonts directly in HTML/CSS as data:image/png;base64,… to save HTTP requests.

📧 Email (MIME)

Attachments and headers in emails are Base64-encoded — decode one to see what's inside.

📦 JSON & APIs

Binary data (keys, files, certificates) travels safely inside JSON fields as Base64 text.

💻 Base64 in your code (cheat sheet)

Use these native one-liners instead of a website for repeated work:

JavaScript

// encode (UTF-8 safe)
btoa(unescape(encodeURIComponent('text')));
// decode
decodeURIComponent(escape(atob('dGV4dA==')));

Python

import base64
base64.b64encode('text'.encode()).decode()  # encode
base64.b64decode('dGV4dA==').decode()        # decode

PHP

base64_encode('text');   // encode
base64_decode('dGV4dA=='); // decode

Linux / macOS terminal

echo -n 'text' | base64        # encode
echo 'dGV4dA==' | base64 --decode # decode
Privacy first: everything runs locally with your browser's native encoding functions. Your data is never uploaded, stored or sent anywhere — safe even for tokens and production payloads. Remember: Base64 is not encryption — anyone can decode it.

❓ Frequently asked questions

Is Base64 encoding the same as encryption?

No. Base64 is an encoding, not encryption. It converts binary data into printable ASCII text so it survives text-only systems (email, JSON, URLs). Anyone can decode it with no key — never use it to hide passwords or secrets.

Is my data uploaded to a server?

No. Everything runs locally in your browser. Your text and files never leave your device — nothing is uploaded, stored or logged.

What is URL-safe Base64?

URL-safe Base64 (RFC 4648 §5) replaces + with - and / with _, and drops the = padding, so the output can sit inside URLs, filenames and OAuth state parameters without percent-encoding. Tick the URL-safe box to use it.

Why does Base64 output get ~33% bigger?

Base64 packs 3 bytes of input into 4 ASCII characters, so output is roughly 33% larger than the input. That's the trade-off for making binary data safe for text-only transport.

Can I convert an image to a Base64 data URI?

Yes. Upload any image with the file option, then click Image → data URI to get a data:image/…;base64,… string you can paste straight into HTML or CSS — perfect for small icons and logos.

Is this Base64 tool really free?

Yes — completely free, no sign-up, no limits and no watermarks. It works offline too, once the page has loaded.

🔗 See also

Person working on a laptop at home
{ }

Free JSON Formatter

Beautify, minify & validate JSON — tree view, error finder, copy & download.

Format →
Person working on a laptop at home
🔐

Free Password Generator

Create strong, random passwords with a strength meter — free and private.

Generate →
Person working on a laptop at home
🔳

Free QR Code Generator

Turn any link or text into a scannable QR code instantly.

Create →

Card photos: Shixart1985 / Wikimedia Commons, CC BY 2.0

Related tools

Person working on a laptop at home
🛠️

Free Strong Password Generator — Secure Random Passwords

Free strong password generator: create secure random passwords with uppercase, lowercase, numbers and symbols.…

Open →
Person working on a laptop at home
🛠️

Free Meta Tag Generator — SEO, Open Graph & Twitter

Free meta tag generator. Create SEO titles, descriptions, Open Graph, Twitter Card and robots.txt code in seconds.…

Open →
Person working on a laptop at home
🛠️

Free QR Code Generator — Create & Download QR Codes

Free QR code generator. Create custom QR codes for URLs, text and contacts, then download as a high-resolution PNG.…

Open →
Person working on a laptop at home
🛠️

Free Color Picker — HEX, RGB & Contrast Checker

Free color picker: pick any color, get HEX, RGB, HSL with one-click copy, WCAG contrast checker with AA/AAA badges…

Open →
Person working on a laptop at home
🛠️

Free Favicon Generator — Create ICO & PNG Favicons Online

Free online favicon generator: upload a logo or design a text icon, preview it in a browser tab, then download…

Open →

Card photos: Shixart1985 / Wikimedia Commons, CC BY 2.0

Share:
Disclaimer: The information and estimates on this page are for general guidance only and are not professional financial, legal or medical advice — always verify with official sources before acting. Photos on this page are copyright-free originals, credited to the photographer and source with the licence noted.