Base64 Encoder/Decoder

code

Convert text to Base64-encoded strings or decode Base64 back to plain text. Base64 encoding is commonly used for transmitting binary data over text-based protocols and embedding data in URLs, JSON, or XML.

Base64 Encoder/Decoder
Encode text to Base64 or decode Base64 to text
Characters: 0Words: 0Sentences: 0Lines: 0

Options

Characters: 0Words: 0Sentences: 0Lines: 0

Base64 Encoder & Decoder - Free Online Tool

What is a Base64 encoder/decoder?

A Base64 encoder/decoder turns binary or text data into a 64-character alphabet so it can travel through systems that only accept text. It also reverses the process, returning the original content. Use it when you need to move tokens, small images, or configuration values through URLs, JSON, or email without corruption. This tool runs locally, so nothing leaves your device.

How to use the Base64 encoder/decoder

  1. Paste your input: Add plain text to encode or a Base64 string to decode. The tool handles any length and supports Unicode.
  2. Pick the direction: Choose Encode or Decode.
  3. Get results: The output appears instantly. Copy it or download as a text file for use in code or configs.

Why use this Base64 tool?

  • Safe transmission: Protects binary or special characters when sending data through text-only channels.
  • Developer friendly: Validate API payloads, email attachments, and data URIs without opening a terminal.
  • Local privacy: All work stays in your browser, so secrets like API keys remain private.

Use case 1: Embed small assets

Convert an icon to Base64 and drop it into a CSS or HTML data URI to avoid extra requests.

Use case 2: Move tokens in requests

Encode session tokens before adding them to URLs or JSON to avoid breaking characters.

Use case 3: Email attachments

Quickly decode a Base64 email attachment string to verify its contents without saving files.

Examples

Basic example

Input (encode): Hello, World!
Output: SGVsbG8sIFdvcmxkIQ==

Advanced example

Input (encode): {"message":"Hello 世界","emoji":"🌍"}
Output: eyJtZXNzYWdlIjoiSGVsbG8g5LiW55WMIiwiZW1vamkiOiLwn4yNIn0=

Common errors

Invalid Base64 string

If decoding fails, remove spaces or line breaks and ensure only A–Z, a–z, 0–9, +, /, and = appear. For URL-safe strings, switch to the URL-safe option.

Garbled decoded text

Mismatched character encoding can scramble output. This tool uses UTF-8; re-encode your source in UTF-8 and try again.

Tips and proven approaches

  • Expect about 33% size growth after encoding; avoid it for large binaries.
  • For URLs, use the URL-safe alphabet (- and _) to prevent escaping.
  • Validate secrets before storing by decoding once to confirm the content.

Related tools

Privacy and security

Encoding and decoding happen entirely in your browser. No inputs or outputs are sent to servers, so keys, tokens, and files stay private.

Frequently Asked Questions
Base64 is a binary-to-text encoding scheme that represents binary data in an ASCII string format. It's commonly used to encode data that needs to be stored or transferred over media designed to handle text.
Use Base64 when you need to encode binary data for transmission over text-based protocols (like email or JSON), embed images in HTML/CSS, or store binary data in text-based formats.
Yes, this tool properly handles UTF-8 encoded Unicode characters when encoding and decoding.