Base64 Encoder & Decoder
Encode or decode UTF-8 text as standard or URL-safe Base64. Useful for API payloads, Basic Auth debugging, and data snippets.
This conversion runs only in your browser — nothing is uploaded.
URL-safe uses - and _ instead of + and /, and omits = padding.
- Input0
- Output0
- OptionsStandard
Input
Output
For image files, use Image to Base64 — Data URI Encoder
What is this tool?
This Base64 encoder and decoder converts between UTF-8 text and Base64. Choose Standard (+/ with = padding) or URL-safe (-_ without padding) depending on where the value will be used.
Base64 is encoding, not encryption: there is no secret key, and anyone can reverse the string. Output is about one-third larger than the input because every three bytes become four ASCII characters.
Use it for text payloads, Basic Auth debugging, and short data snippets. It is not a file encoder—use Image to Base64 for binary images and data URIs.
Common use cases
- Prepare or inspect Base64 fields in API JSON bodies and headers
- Build or decode the credential part of an HTTP
Authorization: Basic …header - Encode short text for data-URI style snippets (text only; images belong on Image to Base64)
How to use
- Choose Encode or Decode. Conversion updates live as you type.
- Toggle URL-safe when the value must use
-_and omit=padding. - Paste UTF-8 text (encode) or a Base64 string (decode). Whitespace in Base64 input is ignored.
- Copy the output. If decode fails, match Standard vs URL-safe and check padding or truncation.
Examples
| Input / setting | Output | Notes |
|---|---|---|
Hello → Standard encode | SGVsbG8= | Classic UTF-8 sample with padding. |
SGVsbG8= → Decode | Hello | Round-trip of the sample above. |
user:pass → Standard encode | dXNlcjpwYXNz | Credential blob before a Basic Auth header. |
subjects?_d → URL-safe encode | c3ViamVjdHM_X2Q | Uses _ instead of / and omits = (edge vs standard). |
Practical pitfalls
- Base64 is not encryption or access control—treat encoded secrets as still exposed.
- Mixing alphabets breaks consumers: a JWT-style URL-safe string will fail many “standard only” decoders if you leave
-_or strip padding incorrectly. - This page encodes text, not arbitrary files; large binaries belong in Image to Base64 or offline tooling.
References
Last reviewed: 2026-07-26
Frequently asked questions
- Is Base64 encryption?
- No. Base64 is reversible encoding with no secret key. Anyone with the string can decode it.
- What is the difference between standard and URL-safe Base64?
- Standard Base64 uses + and / and often ends with = padding. URL-safe Base64 (RFC 4648 §5) uses - and _ instead and usually omits padding so the value can sit in query strings or path segments.
- Why does decoding fail with a padding or alphabet error?
- Strict decoders expect a matching alphabet and valid length. Missing = padding, mixed +/ with -_, or truncated strings are common causes. Try the matching Standard or URL-safe mode, or add padding until the length is a multiple of four.
- Can I encode an image file here?
- This tool is for UTF-8 text. For image files and data URIs, use the Image to Base64 tool instead.