Base64 Generator & Encoder
Generate random base64 strings or encode/decode text.
Base64 is a binary-to-text encoding scheme that represents binary data in an ASCII string format. It is widely used in web development, APIs, and cryptography to safely transfer binary data through text-based channels such as HTTP headers, JSON payloads, and email. This tool lets you encode text to Base64, decode Base64 strings, and generate cryptographically random Base64 secrets — all without any data leaving your browser.
How to Use
- 1
Choose your operation
Select the "Generate" tab to create a random Base64 secret, or switch to "Encode / Decode" to convert between plain text and Base64.
- 2
For generation: select byte size
Choose the byte size (16, 32, 64, or 128 bytes) for your random Base64 string. Larger values produce longer, more secure secrets.
- 3
For encode/decode: enter your text or Base64 string
Type or paste your input into the text area. Click "Encode" to convert text to Base64 or "Decode" to convert Base64 back to plain text.
- 4
Copy the result
Use the copy button to copy the output to your clipboard and use it in your project.
Features
Text to Base64 Encoding
Encode any plain text string into its Base64 representation using the btoa standard.
Base64 to Text Decoding
Decode any Base64 string back into its original plain text representation.
Random Base64 Secret Generation
Generate cryptographically random Base64 strings using the Web Crypto API — perfect for API keys and secrets.
100% Client-Side & Private
All encoding, decoding, and generation happens locally in your browser. No data is ever transmitted.
Frequently Asked Questions
- What is Base64 encoding?
- Base64 is an encoding scheme that converts binary data into a text format using 64 ASCII characters (A-Z, a-z, 0-9, +, /). It is commonly used to embed binary data such as images, cryptographic keys, and files inside JSON, HTML, or HTTP headers.
- Is Base64 encryption?
- No. Base64 is encoding, not encryption. Anyone can decode a Base64 string back to its original form without a key. It is used for data transport and formatting purposes, not for security.
- When should I use Base64?
- Use Base64 when you need to embed binary data in text-based formats (e.g., images in CSS/HTML data URIs), send binary data in JSON or XML, or store binary data in environment variables and config files.
- What is the difference between standard Base64 and URL-safe Base64?
- Standard Base64 uses + and / characters which can cause issues in URLs. URL-safe Base64 replaces + with - and / with _ to make the output safe for use in URLs and filenames.