Base64 Encoder / Decoder
Encode plain text to Base64 or decode Base64 strings instantly. Supports standard and URL-safe Base64. Runs entirely in your browser — nothing is ever sent to a server.
🔢 Base64 Encoder / Decoder
Enter plain text to encode, or paste a Base64 string to decode. Results appear below instantly.
What Is a Base64 Encoder?
This free Base64 encoder and decoder converts plain text to Base64 format and decodes Base64 strings back to readable text — instantly, entirely in your browser. This Base64 encoder also supports URL-safe Base64, which replaces + and / with − and _ for safe use in URLs and filenames without percent-encoding.
Base64 encoding is used throughout web development, APIs, and data transfer. In fact, you encounter Base64 every time you see an embedded image in HTML, inspect a JWT token, send an email attachment, or set up HTTP Basic Authentication. This Base64 encoder makes all of those conversions instantly accessible.
How Does This Base64 Encoder Work?
This Base64 encoder converts every 3 bytes of input data into 4 Base64 characters from the standard 64-character alphabet (A–Z, a–z, 0–9, +, /). If the input is not divisible by 3 bytes, padding characters (=) are added to complete the last group. The URL-safe mode of this Base64 encoder replaces + with − and / with _ and removes the = padding entirely.
Output size ≈ input size × 4/3 (approximately 33% larger)
URL-safe: replace + → − and / → _ and strip = padding
How to Use This Base64 Encoder
- To encode: Type or paste plain text into the input field, then click “Encode to Base64”. The Base64-encoded result appears in the output.
- To decode: Paste a Base64 string into the input field, then click “Decode from Base64”. The original plain text appears in the output.
- URL-safe mode: Check the URL-safe option before encoding if you need the result for use in a URL, cookie, or filename without percent-encoding.
- Copy: Click the Copy button to copy the output to your clipboard.
When to Use This Base64 Encoder
- Embedding images in HTML or CSS: Convert image data to Base64 with this encoder for use as data URIs (data:image/png;base64,…) — eliminating a separate HTTP request.
- JWT token inspection: JWT tokens use URL-safe Base64 for their header and payload sections. Decode them with this Base64 encoder to read the contents without a third-party tool.
- HTTP Basic Authentication: Basic Auth sends username:password as a Base64 string in the Authorization header. Use this Base64 encoder to create or verify those credentials.
- Email attachments: MIME encoding uses Base64 to convert binary file attachments into text for safe email transmission.
- API payloads: Some APIs require binary data — images, PDFs, certificates — to be Base64-encoded before including in JSON payloads.
Is This Base64 Encoder Safe?
Yes — this Base64 encoder runs entirely in your browser using JavaScript’s built-in btoa() and atob() functions. No data is ever sent to any server. Even the developers of this site cannot see what you encode or decode. However, Base64 is not encryption. According to the MDN Web Docs Base64 reference, Base64 is a binary-to-text encoding scheme — it provides interoperability, not security. Anyone who has a Base64 string can decode it instantly.
Base64 Encoder — Frequently Asked Questions
Explore All NerdyTools By Categories
Find the right tool for any task — free, fast, and no sign-up required
