Base64 Encoder / Decoder
Base64 encoding converts binary data into a text-safe format that can travel through systems designed to handle only plain text, such as email bodies, JSON payloads, and URL query strings. This free online tool lets you encode any plain-text string into its Base64 representation or decode an existing Base64 string back into readable text with a single click. Working with JSON that contains Base64 fields? Format it first with the JSON Formatter. It handles the full UTF-8 character set, so accented letters, emoji, and characters from non-Latin scripts all convert correctly. You can see character counts for both the input and the output at a glance, which is useful when working with size-limited fields. For URL-safe encoding instead, use the URL Encoder / Decoder. All processing runs locally in your browser — nothing is uploaded to a server. Copy the result to your clipboard instantly and paste it wherever you need it.
How to Use This Tool
- Type or paste your text into the input field. This can be plain text you want to encode, or a Base64 string you want to decode.
- Select the direction: Encode to convert plain text to Base64, or Decode to convert Base64 back to readable text.
- Review the output in the result area. Character counts for both input and output are displayed so you can gauge the size change.
- Click the copy button to place the result on your clipboard, ready to paste into your code, config file, or API request.
Examples
Encoding Plain Text to Base64
Input (plain text)
Hello, World!
Output (Base64)
SGVsbG8sIFdvcmxkIQ==
Decoding Base64 Back to Text
Input (Base64)
SGVsbG8sIFdvcmxkIQ==
Output (plain text)
Hello, World!
Encoding a JSON Payload
Input (plain text)
{"user":"admin","role":"editor"}Output (Base64)
eyJ1c2VyIjoiYWRtaW4iLCJyb2xlIjoiZWRpdG9yIn0=
What This Tool Is Useful For
- Embedding images in CSS: Convert small images or icons to Base64 data URIs so they load inline without additional HTTP requests.
- API authorization headers: HTTP Basic Auth requires the username:password pair to be Base64-encoded before placing it in the Authorization header.
- Email attachments: MIME-encoded emails use Base64 to embed binary attachments inside the text-based email format.
- Data URIs in HTML: Embed fonts, SVGs, or small files directly into HTML using the
data:URI scheme with Base64 content. - Debugging encoded values: Quickly decode Base64 strings you encounter in JWT tokens, API responses, or log files to see their original content.
Frequently Asked Questions
- What is Base64 encoding?
- Base64 is a binary-to-text encoding scheme that represents data using 64 printable ASCII characters (A-Z, a-z, 0-9, +, and /). It was designed so binary data can pass through systems that only handle text, such as email protocols and JSON payloads, without being corrupted.
- Why would I use Base64 instead of sending raw text?
- Raw text can contain characters that break certain transport layers — newlines, null bytes, or non-ASCII characters may be stripped or misinterpreted. Base64 guarantees the output contains only safe, printable characters. It is commonly used for embedding binary files in HTML/CSS, constructing HTTP authorization headers, and transmitting data through APIs that expect text-only values.
- Is Base64 the same as encryption?
- No. Base64 is an encoding, not encryption. Anyone can decode a Base64 string without a key or password. It provides zero confidentiality. If you need to protect sensitive data, use proper encryption (such as AES or TLS) before or in addition to Base64 encoding.
- Does this tool handle UTF-8 characters correctly?
- Yes. The encoder first converts your input to a UTF-8 byte sequence and then Base64-encodes those bytes. This means accented characters (e.g. cafe), emoji, and characters from non-Latin scripts (e.g. Chinese, Arabic, Devanagari) all round-trip correctly through encode and decode.
- How much larger does data get after Base64 encoding?
- Base64 encoding increases the size by approximately 33%. Every 3 bytes of input become 4 bytes of output. For example, a 300-byte string produces roughly 400 characters of Base64 output. This overhead is the trade-off for text-safe transport.
More Developer Tools
Need to format a JSON payload? JSON Formatter & Validator. Need a strong credential? Password Generator. Generate a QR Code from your encoded data. Browse all utilities in the Developer Tools hub.
Related Tools
JSON Formatter
Format, validate, and beautify JSON data with syntax highlighting.
Password Generator
Generate strong, random passwords with customizable length and character sets.
UUID Generator
Generate random UUIDs (v4) and nil UUIDs instantly for your applications.
Hash Generator
Generate MD5, SHA-1, SHA-256, and SHA-512 hashes from any text input.