Encode
Decode
UTF-8 text
Bytes (hex)
Standard
URL-safe
UTF-8 text
Output
Result appears here.
Type or paste input, or load the example to see the result here.
How to encode and decode Base64 online
Base64 Encoder converts text or raw bytes to Base64 and back, in this browser tab, without uploading anything. You choose whether the input is UTF-8 text or hex bytes, whether to use the standard alphabet or the URL-safe one, and how strictly to read padding and whitespace when decoding. When input cannot be decoded, the page names the exact problem — an invalid character, bad padding, or invalid UTF-8 — and the byte offset where it appears.
Encode or decode a value in four steps
- Pick encode or decodeThe mode control switches direction. Encode turns your input into Base64; decode reads Base64 and gives back the original text or bytes. The result updates as you type, so there is no run button to press.
- Say what the content isChoose UTF-8 text for ordinary strings, or Bytes (hex) when you are working with binary data. In byte mode the input and output are hex pairs such as 48 65 6c, and whitespace between pairs is allowed.
- Choose the alphabetStandard Base64 uses plus and slash; URL-safe Base64 uses minus and underscore instead, which is what JWTs, query strings, and filenames need. Decoding uses the same selector, so pick the alphabet the value was produced with.
- Set the decode policy, then copy or downloadStrict rejects any whitespace or wrong-length padding. Lenient strips whitespace, restores missing padding, and tells you which repairs it made. Copy the result to the clipboard, or download it as a .txt file — or a .bin file when you decode to bytes.
What people use Base64 Encoder for
- Read a Base64 blob from a log or config filePaste a value out of a YAML file, an environment variable, or a request body and see the plain text it stands for.
- Decode a JWT segment by handToken segments are URL-safe Base64 without padding. Pick URL-safe plus lenient and the missing padding is restored for you.
- Encode a value for a header or query stringTurn a credential or an identifier into Base64 before putting it into an Authorization header, a data URI, or a URL parameter.
- Inspect binary data as hexDecode to Bytes (hex) to see the actual byte sequence, which is how you spot a stray BOM or a file that is not the format you expected.
Base64 questions
- Is my input uploaded anywhere?
- No. Encoding and decoding both run in this browser tab, and the value is not sent to a server, logged, or stored.
- Is Base64 encryption?
- No. Base64 is not encryption and gives no confidentiality at all — it is a reversible text representation of bytes, and anyone who sees the string can decode it. Use it to move binary data through text channels, never to protect a secret.
- What is the difference between standard and URL-safe Base64?
- They differ in the last two characters of the alphabet. Standard uses plus and slash; URL-safe uses minus and underscore so the value survives being placed in a URL path, query string, or filename.
- Why does decoding say invalid padding?
- Base64 works in groups of four characters, padded with equals signs. A value that was stored without padding has a length that is not a multiple of four. Switch the decode policy to lenient and the missing padding is added for you.
- Does the encoder let me leave the padding off?
- Not from this page — encoded output is always padded with equals signs. If a consumer wants unpadded output, trim the trailing equals signs yourself; decoding here accepts either form in lenient mode.
- Why do I get invalid UTF-8 when decoding?
- The Base64 was valid but the bytes behind it are not text — for example an image or a compressed archive. Switch the content mode to Bytes (hex) to read the data, and use the download button to save it as a file.