Base64 Encode/Decode
Base64 turns binary-friendly byte sequences into a printable alphabet of letters, digits, plus, slash, and padding equals signs. Developers use it to embed small payloads in JSON, email-adjacent formats, data URLs, and configuration strings that dislike raw binary. This tool encodes plain text with UTF-8 so international characters and emoji survive the round trip, and it decodes Base64 back into readable text when the input is well formed. Encoding is not encryption: anyone can reverse Base64. Use it for transport and embedding needs, keep secrets behind real access controls, and prefer purpose-built file tools when you work with large binaries instead of text pasted into a browser.
Informational only; verify critical results independently.
How to use
- Paste the plain text you want to encode, or paste an existing Base64 block you want to read.
- Choose Encode to produce a Base64 string from UTF-8 bytes of your text.
- Choose Decode when your clipboard already holds Base64 and you need the original characters back.
- Copy the output into a data URL prefix, HTTP header experiment, or config field that expects Base64 text.
- If decode fails, strip newlines, spaces, and surrounding quotes that often cling to values copied from logs.
- For URL-safe contexts, remember that standard Base64 uses + and /; some systems want - and _ instead.
- Pad with = when a truncated paste removed padding; valid lengths are typically multiples of four characters.
- Verify a round trip: encode a phrase you know, decode the result, and confirm the text matches before trusting a pipeline.
- Keep payload size modest in the browser; huge blobs belong in command-line or desktop Base64 utilities.
- Never rely on Base64 alone to hide API keys or passwords—treat encoded text as publicly readable.
Examples
- Encode Hello, world! → SGVsbG8sIHdvcmxkIQ==
- Decode SGVsbG8sIHdvcmxkIQ== → Hello, world!
- Encode Test ✓ → Base64 of UTF-8 bytes for the check mark and letters.
- Encode {"ok":true} → eyJvayI6dHJ1ZX0= for embedding compact JSON.
- Decode a Basic authentication training string for user:pass after you intentionally encode that pair.
- Encode a short shell snippet → Base64 text you can paste through a channel that mangles quotes.
- Encode café → Base64 reflecting UTF-8 for é, not a single-byte Latin-1 assumption.
- Strip whitespace from a PEM-like Base64 blob pasted with line breaks, then decode the continuous alphabet.
- After encoding, replace + with - and / with _ when a JWT-style or URL-safe profile requires it.
- Decode fails on abc! → invalid alphabet character shows why only the Base64 alphabet is accepted.
FAQ
- Is Base64 a form of encryption?
- No. Base64 is an encoding that expands bytes into printable characters so they survive text-safe channels. Anyone with the string can decode it. Confidentiality requires encryption and access control; Base64 only changes representation.
- Why does this tool emphasize UTF-8?
- Text must become bytes before Base64 applies. UTF-8 is the web’s default so accented letters and emoji map predictably. If a legacy system used another charset, decoding as UTF-8 can look wrong even when the Base64 itself is syntactically valid.
- Why does decoding fail with a cryptic error?
- Common causes include truncated strings, missing = padding, non-alphabet characters, or accidental HTML wrapping. Paste only the Base64 body. If you copied from email or PDF, remove soft line breaks that split the alphabet mid-stream.
- What is URL-safe Base64?
- Standard Base64 uses + and /, which are awkward inside URLs. URL-safe variants substitute - and _ and sometimes drop padding. This tool follows the standard alphabet; convert manually when a protocol documents the URL-safe profile.
- Can I encode binary files here?
- This page is optimized for text you can paste. Images, PDFs, and executables are better handled by dedicated file encoders or shell utilities that stream bytes. Pasting binary into a text box risks corruption and memory pressure.
- Why does encoded text get longer?
- Base64 represents 3 bytes as 4 characters, so length grows by about one third, plus padding. That expansion is the cost of a restricted alphabet. Compression belongs in a separate step if size is the constraint.
- How is Base64 used in data URLs?
- A data URL can embed small resources as data:[mime];base64,[payload]. Encoding SVG or CSS snippets this way avoids extra HTTP requests for tiny assets. Large Base64 data URLs still cost download size and can hurt caching strategies.
- What about Basic authentication headers?
- HTTP Basic historically sent Base64(username:password). Encoding does not protect the credentials on an unencrypted channel. Prefer HTTPS and modern auth flows; treat any Basic examples as learning aids, not a recommended production pattern.
- Do line breaks matter inside Base64?
- Many specs allow whitespace to be ignored; others expect a continuous string. If decode fails, remove newlines and spaces then retry. When embedding in JSON, keep the value as one string without breaking it for aesthetics unless your consumer strips whitespace.
- Can I encode extremely large text?
- Browsers have memory and UI limits. Keeping payloads under roughly a megabyte is a practical ceiling for interactive paste tools. For bulk conversion jobs, use CLI utilities that stream from disk.
- Why do two encoders sometimes disagree slightly?
- Differences usually come from trailing newlines in the source text, UTF-8 versus another charset, or URL-safe alphabet substitutions. Compare the exact input bytes, not just the characters you see in a word processor.
- Where is my data processed?
- Encoding and decoding run in your browser. Nothing needs to be uploaded to Vastorae for the transform. Still avoid pasting production secrets into pages on shared or untrusted devices.
Formula / Method
Assumptions & Limitations
Related guides
Related tools
Last updated: 2026-07-13