Base64 Encoder & Decoder β€” Encode and Decode Base64 Instantly

Paste text or drop a file to encode to Base64 β€” or paste Base64 to decode it. Real-time conversion with full UTF-8 support, URL-safe mode, and data URI output for images.

Plain Text0 B
Base64 Output
Base64 output will appear here...

What Is Base64 Encoding?

Base64 is a binary-to-text encoding scheme that represents binary data in an ASCII string format. It uses a 64-character alphabet β€” A-Z, a-z, 0-9, +, and / β€” plus = for padding. Every 3 bytes of input become 4 characters of output, making it safe to transmit binary data through text-only channels like JSON APIs, email (MIME), XML, HTML, and URL parameters.

When Developers Use Base64

βœ“Data URIs: Embed images directly in HTML or CSS without extra HTTP requests β€” ideal for small icons and sprites
βœ“HTTP Basic Auth: Encode username:password credentials for Authorization headers
βœ“JWT Tokens: The header and payload sections of JSON Web Tokens are Base64url-encoded
βœ“Email (MIME): Binary attachments are Base64-encoded for safe transport through email protocols
βœ“API Transport: Send binary data through JSON APIs that only support text values
βœ“Config & Storage: Store binary data in text columns, environment variables, and config files

Base64 Is NOT Encryption

A critical distinction: Base64 is encoding, not encryption. It provides zero security β€” anyone can decode a Base64 string instantly. It's designed for data representation and transport, not protection. If you need to protect sensitive data, use proper encryption (AES-256, RSA) first, then optionally Base64-encode the encrypted output for text-safe transport. Never rely on Base64 alone to hide passwords, API keys, or personal data.

Full UTF-8 Support

The native JavaScript btoa() function only handles Latin-1 characters. This tool uses TextEncoder and TextDecoder to properly encode and decode the full range of Unicode characters including emoji (🌍), Chinese/Japanese/Korean text, Arabic, Cyrillic, accented characters (Γ‘, ΓΌ), and any other UTF-8 content. Your Base64 output will always be correct, regardless of the input language.

100% Client-Side β€” Your Data Stays Private

All encoding and decoding runs entirely in your browser using native JavaScript APIs. No data is ever sent to a server, stored, or logged. This makes it safe to encode sensitive values like API keys, authentication tokens, and credentials. Close the tab and everything is gone.

Frequently Asked Questions

Is my data safe? Does anything get sent to a server?
No. All encoding and decoding happens entirely in your browser using JavaScript. No data is transmitted to any server, stored, or logged. This is safe for encoding sensitive data like API keys, authentication tokens, and personal information.
What is Base64 encoding?
Base64 is a binary-to-text encoding scheme that converts binary data into a string of ASCII characters using a 64-character alphabet (A-Z, a-z, 0-9, +, /). It’s used whenever binary data needs to be transmitted or stored in a text-only format.
Is Base64 the same as encryption?
No. Base64 is encoding, not encryption. It provides zero security β€” anyone can decode a Base64 string instantly. If you need to protect sensitive data, use proper encryption (AES, RSA) and then optionally Base64-encode the encrypted output.
Why does Base64 increase file size by 33%?
Base64 converts every 3 bytes of input into 4 bytes of output. The encoded output is always approximately 4/3 the size of the input β€” about 33% larger.
What is URL-safe Base64?
Standard Base64 uses + and / which have special meaning in URLs. URL-safe Base64 replaces + with - and / with _ and typically omits trailing = padding. This variant is used in JWT tokens, URL query parameters, and filenames.
Can I convert an image to Base64?
Yes. Switch to the File/Image tab, then drag and drop an image or click to upload. The tool outputs the raw Base64 string, a complete data URI, an HTML img tag, and a CSS background-image rule β€” all with one-click copy buttons.
What file types can I encode?
Any file type. While images (PNG, JPG, GIF, SVG, WebP) are the most common, you can encode PDFs, fonts, JSON, text files, or any binary data. The tool auto-detects the MIME type.
Does this support UTF-8 and emoji?
Yes. Unlike many Base64 tools that only handle ASCII, this tool fully supports UTF-8 including emoji, CJK characters, Arabic, Cyrillic, accented characters, and any other Unicode text.
What’s the maximum file size?
The tool handles files up to 10 MB. The resulting Base64 string will be about 33% larger (~13.3 MB for a 10 MB file). For very large files, consider encoding on the server side.

Related Tools

Related Tools