Encode ↔ decode Base64 strings locally
Supports URL-safe Base64 and instant copy — all in your browser

This Base64 String Encoder/Decoder converts plain text to Base64 and decodes Base64 back into text. It also supports URL-safe Base64 (often called Base64URL), which is commonly used in tokens and web APIs.
Important: Base64 is an encoding, not encryption. If you need confidentiality, use real encryption (and treat Base64 as just a transport format).
Who is this for?
Nice pairing: If you’re packaging data for a workflow, you might also like our Hash Text (to verify integrity) or Encrypt / Decrypt Text (to protect sensitive content).
Decode Base64 to text
Paste your Base64 into “Base64 to string”. Enable “URL-safe” if the value uses and _ instead of and .
Encode text to Base64
Type any text into “String to base64”. Toggle “URL-safe” if you need a Base64URL output for web usage.
Copy the result
Use the copy button to avoid hidden whitespace issues. If the decoder shows “Invalid base64 string”, re-check URL-safe mode and padding.
How to read the output
Example 1: Why “Man” becomes “TWFu”
The ASCII bytes for “Man” are . Base64 packs 3 bytes into 24 bits, then splits into 4 groups of 6 bits.
In terms of Base64 output characters, you get 4 characters for every 3 input bytes. That’s why encoded strings often look “longer” than the original.
Try it: put TWFu in “Base64 to string” to get Man.
Example 2: Base64URL padding and why “=” disappears
Standard Base64 output length is typically a multiple of . When a system uses Base64URL, it may remove padding characters .
Here is the length of the Base64URL string (without padding), and is how many padding characters you would add back (0, 1, or 2) to make it standard Base64.
Quick sanity check
- or _, enable URL-safe.1) Debug a data URL header
Background: You copied an image string that starts with data:image/png;base64,.
Input: Paste the full value into “Base64 to string”.
Result: The tool ignores the prefix and decodes the Base64 portion. If the output is unreadable, that’s expected for binary.
How to apply: Keep it encoded, or extract the MIME type and confirm it matches expectations.
2) Inspect a token-like string
Background: You have a compact string from an API response.
Input: Try decoding with URL-safe enabled.
Result: If it decodes into JSON-like text, you can quickly see fields. If it stays unreadable, it may be encrypted or compressed.
How to apply: If it’s JSON, you can validate integrity with our Hash Text tool.
3) Send binary-ish content through text channels
Background: A system only accepts plain text, but you need to transport bytes.
Input: Encode the original text to Base64.
Result: A Base64 string that is safe to paste into many tools (logs, JSON fields, emails).
How to apply: On the receiving side, decode back to the original.
4) Store “safe” strings in configs
Background: A config format breaks on special characters or newlines.
Input: Encode your text (possibly including newlines) into Base64.
Result: A single-line payload. For URL contexts, use URL-safe Base64.
How to apply: Decode only where needed; consider encrypting first for secrets.
API debugging
Decode fields returned as Base64 to see what’s inside.
Integrity checks
Encode data consistently before hashing with Hash Text.
Email and copy/paste
Convert text into a single-line string that survives pasting.
Config portability
Store text safely in formats sensitive to whitespace.
Reproducible bugs
Share a Base64 payload that reproduces an issue exactly.
URL-safe outputs
When a system rejects + or /.
When it might not be the right tool
Pro tip: If decoding fails, toggle URL-safe, then check for missing padding. Base64URL often omits .
Base64 maps raw bytes into characters from a fixed alphabet. Conceptually:
Each 6-bit value is an index into the Base64 alphabet.
Padding rules
If the input length is not a multiple of bytes, standard Base64 adds padding to make the output length a multiple of .
Base64 vs Base64URL
Base64URL uses the same 6-bit grouping, but replaces characters to be URL-friendly:
Common prefixes and formats
data:<mime>;base64, is a “data URL” prefix. The Base64 data comes after the comma.Encoding vs hashing vs encryption
Encoding
Reversible transform for transport. Base64 is here.
Hashing
One-way fingerprint for integrity. Try Hash Text.
Encryption
Protects confidentiality. Try Encrypt / Decrypt Text.
No. Base64 is a reversible encoding. Anyone can decode it. If you need confidentiality, encrypt first, then Base64-encode if you need a text transport.
The common causes are: wrong URL-safe setting, missing padding , or hidden whitespace/newlines.
Base64URL replaces characters that can be awkward in URLs and may remove padding. The underlying bit grouping is the same.
Base64 turns bytes into characters. The overhead is about .
Yes. This tool is designed for text input. For arbitrary binary files, you typically need a file-to-Base64 workflow.
It can be. The decoded bytes might represent compressed data, encrypted data, or non-text binary. In that case “text view” will look random.
Yes — the conversion runs in your browser, and the copy button uses your clipboard.
Use a simple chronometer (stopwatch) to track elapsed time down to milliseconds. Runs locally in your browser.
Normalize email addresses to a standard format for easier comparison. Useful for deduplication and data cleaning. Runs locally in your browser.
Estimate the time needed to consume a total amount at a constant rate, and get an expected end time. Runs locally in your browser.
Parse and decode your JSON Web Token (JWT) and display its content. All computation runs locally in your browser.
Know which file extensions are associated to a MIME type, and which MIME type is associated to a file extension. Includes a full MIME types table.
Generate random Lorem Ipsum placeholder text with customizable paragraphs, sentences, and word counts. Runs locally in your browser.