How to use the Base64 Encode & Decode
- 1 Choose Encode or Decode.
- 2 Paste your text or Base64 string; enable URL-safe for Base64URL.
- 3 Copy the result.
What is Base64?
Base64 is a way to represent binary data using only 64 safe ASCII characters: A–Z, a–z, 0–9, + and /, with = as padding. It is used wherever binary data has to travel through systems designed for text, such as email attachments (MIME), data URIs in HTML and CSS, HTTP Basic authentication headers and JSON payloads.
Base64 is encoding, not encryption. Anyone can decode it, so never use it to hide passwords or secrets.
UTF-8 support
Text is converted to UTF-8 bytes before encoding, so accented letters, non-Latin scripts and emoji round-trip correctly: héllo encodes to aMOpbGxv. When decoding, the tool checks that the result is valid UTF-8 text and tells you if the input is not.
URL-safe Base64 (Base64URL)
Standard Base64 uses + and /, which have special meanings in URLs. Base64URL replaces them with - and _ and usually drops the = padding. It is used in JSON Web Tokens (JWT), OAuth and many APIs. The decoder accepts both variants and missing padding automatically.
Size overhead
Base64 output is about 33% larger than the input, because every 3 bytes become 4 characters. Keep that in mind when embedding images as data URIs.
Use it in your code
The same encoder is available through our free API, so you can encode and decode in scripts and pipelines without extra libraries.
Frequently asked questions
Is Base64 secure?
No. Base64 is only an encoding and can be decoded by anyone. Use real encryption to protect sensitive data.
Why does my decoded text look garbled?
The Base64 data probably represents binary content (such as an image) or text in a different character encoding than UTF-8. This tool decodes to UTF-8 text only.
How do I decode a JWT?
A JWT consists of three Base64URL parts separated by dots. Paste the first or second part (header or payload) into the decoder to read its JSON content.
Last updated: