Base64 Encode & Decode Online
Encode text or JSON to Base64, or decode Base64 back to readable text. Supports emoji and URL-safe Base64.
Text Input
Result
What Is Base64 Encoding?
Base64 turns any data into plain text made of letters, numbers, + and /. It is used to send data safely in places that only accept text, such as JSON fields, URLs, HTTP headers (like Basic Auth), emails and data URLs. Decoding turns the Base64 back into the original text.
How to Encode or Decode Base64
- Paste your text, JSON or Base64 into the box.
- Click Encode to make Base64, or Decode to read Base64.
- Click Copy or Download to save the result.
Features
- Full UTF-8 support, so emoji and all languages work.
- URL-safe Base64 option for links and file names.
- Decodes Base64 with or without = padding, line breaks or a data: prefix.
- Formats the result automatically when the decoded text is JSON.
- Runs in your browser. Nothing is uploaded.
Examples
Hello, World! → SGVsbG8sIFdvcmxkIQ== Café ☕ → Q2Fmw6kg4piV user:pass123 → dXNlcjpwYXNzMTIz
The last one is what a browser sends in a Basic Auth header: Authorization: Basic dXNlcjpwYXNzMTIz. Anyone can decode it, which is why Basic Auth must only be used over HTTPS.
Base64 Is Not Encryption
Base64 only changes how data looks; it does not hide it. Anyone can decode it in one click, so never use Base64 to protect passwords, API keys or personal data. To keep data secret, use real encryption, and to store passwords, use a password hashing function such as bcrypt or Argon2.
Standard vs URL-safe Base64
Standard Base64 uses + and /, which have a special meaning in URLs. URL-safe Base64 replaces them with - and _ and usually drops the = padding. For example, the text ??>> becomes Pz8+Pg== in standard Base64 and Pz8-Pg in URL-safe Base64. JWT tokens use URL-safe Base64; you can read one with the JWT Decoder.
Why Is Base64 Bigger?
Base64 turns every 3 bytes into 4 characters, so encoded data is about 33% larger than the original. That is fine for small values, but avoid embedding large images or files as Base64 in JSON or HTML when a normal file link would work.
Base64 in Code
const encoded = btoa(String.fromCharCode(...new TextEncoder().encode(text))) const decoded = new TextDecoder().decode(Uint8Array.from(atob(encoded), (c) => c.charCodeAt(0)))
import base64
encoded = base64.b64encode(text.encode("utf-8")).decode("ascii")
decoded = base64.b64decode(encoded).decode("utf-8")Plain btoa(text) fails with an error on emoji and letters like é, which is why the example above encodes to UTF-8 first.
Frequently Asked Questions
What is Base64?
Base64 is a way to write any data using only letters, numbers, + and /. It is used to put data in URLs, emails, JSON fields, data URLs and HTTP headers.
Does it support emoji and other languages?
Yes. Text is converted to UTF-8 first, so emoji and every language encode and decode correctly.
What is URL-safe Base64?
URL-safe Base64 uses - and _ instead of + and / and drops the = padding, so the result can be used in links and file names. Turn on the option to use it.
Is my data uploaded?
No. Encoding and decoding happen in your browser.