Base64 Encode & Decode Online - Free Text & Data Converter

Base64 encode and decode instantly in your browser — no upload, no sign-up. Supports URL-safe Base64, padding, and data URI output. Free and private.

Tool options

Mode

Options

Input
61 chars · 2 lines · 68 bytes
Output

Paste text or data, get your Base64 encode / decode result instantly

Flip between plain text and Base64 in one click — no sign-up, no waiting, nothing uploaded to a server. Everything runs right in your browser.

How to use it

  1. Choose Encode or Decode using the toggle above the input box.
  2. Paste your text (or a Base64 string) into the input field.
  3. The result appears instantly in the output box.
  4. Hit Copy to grab the result, or use the Data URI button if you need it wrapped for CSS or HTML.

Worked example

Say you want to encode the greeting Hello, World!.

Input: Hello, World!

Base64 output: SGVsbG8sIFdvcmxkIQ==

The two = signs at the end are padding — they keep the output length a clean multiple of 4 characters. To reverse it, switch to Decode, paste SGVsbG8sIFdvcmxkIQ==, and you get Hello, World! right back.

How to Base64 encode/decode in code

Python

import base64

# Encode
encoded = base64.b64encode(b'Hello, World!').decode('utf-8')
print(encoded)  # SGVsbG8sIFdvcmxkIQ==

# Decode
decoded = base64.b64decode('SGVsbG8sIFdvcmxkIQ==').decode('utf-8')
print(decoded)  # Hello, World!

JavaScript (browser & Node.js)

// Encode
const encoded = btoa('Hello, World!');
console.log(encoded); // SGVsbG8sIFdvcmxkIQ==

// Decode
const decoded = atob('SGVsbG8sIFdvcmxkIQ==');
console.log(decoded); // Hello, World!

// Note: btoa/atob handle ASCII only.
// For full UTF-8 support in Node.js:
const enc = Buffer.from('Hello, World!', 'utf8').toString('base64');
const dec = Buffer.from(enc, 'base64').toString('utf8');

How does Base64 work? (The quick version)

Base64 converts binary data into plain text using only 64 safe characters: A-Z, a-z, 0-9, +, and /. That set travels safely through any system that was built for text — email, URLs, JSON, CSS — without garbling.

Every 3 bytes of input become 4 Base64 characters. Here is how the word Man maps through the process:

Character M a n
ASCII (decimal) 77 97 110
Bits (8 each) 01001101 01100001 01101110
Regrouped as 6-bit chunks 010011 | 010110 | 000101 | 101110
Decimal value of each chunk 19 | 22 | 5 | 46
Base64 character T | W | F | u

So ManTWFu. Three bytes in, four characters out — always that 4:3 ratio, which is why Base64 output is about 33% larger than the original.

Important: Base64 is an encoding, not encryption. Anyone can decode it immediately — it provides zero security. Never use it to hide passwords or sensitive data.

Standard vs URL-safe Base64

Standard Base64 uses + and /, which have special meanings in URLs. URL-safe Base64 (sometimes called Base64url) swaps those for - and _, so the string can sit inside a URL or a JWT token without percent-encoding. This tool supports both modes — just pick the one that matches your use case.

Data URI (for images and fonts in CSS/HTML)

A data URI wraps Base64 content with a media-type prefix so a browser can load it inline — no external file needed. The format looks like: data:image/png;base64,iVBORw0K.... Use the Data URI button in this tool to generate that prefix automatically.

When to use Base64 encoding

  • Embedding small images, icons, or fonts directly into CSS or HTML.
  • Sending binary data (like a file) inside a JSON payload or email attachment.
  • Storing binary blobs in databases or environment variables that only accept text.
  • Decoding a JWT (JSON Web Token) payload to inspect its claims.
  • Working with APIs that return Base64-encoded responses (e.g. Google Vision, AWS Rekognition).

When not to use it

  • For security or encryption — Base64 is trivially reversible by anyone.
  • For large files — Base64 adds ~33% size overhead; use direct binary transfer or a CDN instead.
  • For URL encoding of query strings — use percent-encoding (encodeURIComponent) for that, not Base64.

Your data stays private

This tool runs entirely in your browser using JavaScript. Nothing you paste is ever sent to our servers. You can even disconnect from the internet and it will still work. That makes it safe to use with confidential tokens, credentials, or any private text.

For the full technical specification, see RFC 4648 — The Base16, Base32, and Base64 Data Encodings. The browser-native API (btoa / atob) is documented on MDN Web Docs.

Takeaway: Base64 encode and decode in seconds — paste your text or encoded string above and the result is already waiting for you.

Frequently asked questions

Is my data uploaded or stored when I use this tool?+
No. Encoding and decoding happen entirely in your browser with JavaScript. Nothing is sent to any server, logged, or stored. It is safe to use with tokens, API keys, or any private content.
Is Base64 the same as encryption?+
No — Base64 is an encoding format, not encryption. Anyone who sees a Base64 string can decode it instantly without a key or password. Never use it to protect sensitive data; use proper encryption (like AES) for that.
Why does Base64 output end with one or two equals signs (=)?+
Those are padding characters. Base64 groups input into 3-byte chunks and outputs 4 characters per chunk. If the input is not a perfect multiple of 3 bytes, '=' characters are added to round the output up to the nearest multiple of 4 characters.
What is the difference between standard Base64 and URL-safe Base64?+
Standard Base64 uses '+' and '/' characters, which are reserved in URLs. URL-safe Base64 (also called Base64url) replaces them with '-' and '_' so the string can appear in a URL, filename, or JWT without breaking anything. This tool supports both — toggle the URL-safe option to switch.
How do I Base64 encode a string in Python?+
Use the built-in base64 module: import base64; base64.b64encode(b'your text').decode('utf-8'). To decode: base64.b64decode('encoded_string').decode('utf-8').
How do I Base64 encode/decode in JavaScript?+
In the browser use btoa('text') to encode and atob('encoded') to decode. In Node.js, use Buffer.from('text', 'utf8').toString('base64') to encode and Buffer.from('encoded', 'base64').toString('utf8') to decode, which handles full UTF-8 properly.
Can this tool handle large files?+
The tool works well for strings and small files. Very large files (tens of megabytes) may be slow because Base64 is processed in the browser and increases the size by about 33%. For large binary files, command-line tools like openssl base64 or the Python base64 module are more practical.
Is this tool free? Do I need to create an account?+
Completely free, no account needed. Paste your text, get your result — that is all there is to it.