Base64 Encoder & Decoder
Encode plain text to Base64 or decode Base64 strings back to text. Fully UTF-8 compatible and 100% client-side — your data never leaves your browser.
About This Tool
Base64 is a binary-to-text encoding scheme that represents binary data in an ASCII string format. It is widely used in web development for encoding data that needs to be stored and transferred over media designed to deal with text. Common use cases include embedding images directly in HTML or CSS, encoding credentials for HTTP Basic Authentication, and transmitting binary data in JSON payloads.
This tool uses the browser's native btoa() and atob() functions with proper UTF-8 handling, so it correctly encodes and decodes non-ASCII characters, including emojis, Chinese characters, Arabic script, and other Unicode content that standard Base64 tools sometimes break.
All encoding and decoding happens locally in your browser. No data is transmitted to any server, making it safe to use with sensitive information such as passwords, tokens, or private configuration values.
Base64 encoding increases data size by approximately 33%, so it is not a compression method. It is purely a way to represent binary data as printable ASCII characters.
How to Use
- Select the Encode tab to convert plain text to Base64, or the Decode tab to convert Base64 back to plain text.
- Type or paste your input into the text area.
- Click the action button (Encode to Base64 or Decode from Base64).
- The result appears in the output text area below.
- Click Copy to copy the result to your clipboard.
- If you provide an invalid Base64 string when decoding, you will see a clear error message.
Common Use Cases
- Encoding API credentials for HTTP Basic Auth headers
- Embedding small images as data URIs in HTML or CSS
- Encoding binary data to pass in JSON or URL parameters
- Decoding Base64-encoded JWT payloads to inspect their contents
- Encoding configuration secrets in CI/CD environment variables
Frequently Asked Questions
What is Base64 encoding?
Base64 is a method of encoding binary data as a string of ASCII characters. It converts every 3 bytes of data into 4 printable characters, making binary content safe to transmit over text-based systems like email or JSON APIs.
Is Base64 the same as encryption?
No. Base64 is encoding, not encryption. It is easily reversible by anyone — it provides no security. It is used to make data compatible with text-based protocols, not to protect it. Never use Base64 to store passwords or sensitive secrets.
When should I use Base64 encoding?
Use Base64 when you need to transmit binary data (images, files, binary blobs) through a system that only supports text, such as JSON APIs, HTML data URIs, or HTTP Basic Authentication headers.
Why does Base64 increase file size?
Base64 encoding increases data size by approximately 33% because it represents every 3 bytes as 4 characters. It is not a compression method — use gzip or similar tools if you need to reduce size.
Can I use this to decode a JWT token?
Yes. A JWT token has three Base64-encoded parts separated by dots. You can paste the middle part (the payload) into the decoder to inspect its contents. Note that JWT payloads are not encrypted — only signed.