TC

Base64 Encoder / Decoder — Free Online Tool

Processed locally. No data stored. Free forever.
0 chars

Base64 Results

Type something to see all generated styles

What is Base64 Encoder / Decoder?

The Base64 Encoder / Decoder is a bidirectional utility that converts standard human-readable text into a safe, ASCII-based string, and vice versa. Base64 translates complex 8-bit characters (including emojis, foreign alphabets, and binary files) into a restricted 64-character alphabet (A-Z, a-z, 0-9, +, /).

This sanitizes the data, allowing it to be safely transmitted through strict text-based protocols like email (SMTP) or URL parameters without becoming corrupted. From the same interface, you can effortlessly decode those seemingly random strings back into readable text.

When to use Base64 Encoder / Decoder?

Use this tool to safely package data for transmission, or to peek inside data you have received. Web developers encode data directly to CSS files using Data URIs, or inspect JSON Web Tokens (JWT) during API debugging.

Cybersecurity analysts routinely decode Base64 strings to investigate suspicious command-line scripts or HTTP headers. If you specifically need to sanitize data for a web address query string, try the URL Encoder / Decoder instead, as it handles characters differently.

How to use this tool

  1. 1Paste your text or Base64 string
  2. 2Choose 'Encode' or 'Decode'
  3. 3Enable URL-safe option if needed, then copy

When encoding, you will notice the output often ends in one or two equals signs (=). This is called 'padding' and is a structural requirement. When decoding, ensure you paste the entire string, including the padding.

Examples

InputOutput
Hello WorldSGVsbG8gV29ybGQ=
SGVsbG8gV29ybGQ=Hello World (decoded)
{"user":"john"}eyJ1c2VyIjoiam9obiJ9
https://example.com/path?a=1&b=2aHR0cHM6Ly9leGFtcGxlLmNvbS9wYXRoP2E9MSZiPTI=
secret API tokenBase64 encoded version

Rules & Behavior

  • Encoding translates standard UTF-8 text into an underlying binary sequence, groups it into 6-bit chunks, and assigns each chunk a safe Base64 character.
  • Decoding simply reverses the mathematical process, translating the 64-character alphabet back into 8-bit UTF-8 text.
  • The URL-safe toggle (if available) replaces the '+' and '/' characters with '-' and '_' respectively, making the output safe for web routing.

Related Tools

Frequently Asked Questions

What is Base64?

Base64 is a standardized method of converting complex data (like text with special characters, or small files) into a simple, restricted alphabet of 64 safe characters. It ensures that data can be transmitted over text-only protocols without special characters breaking the transmission.

Is Base64 secure encryption?

No. Base64 is encoding, not encryption. It does not use a secret key or password. Anyone who sees a Base64 string can instantly decode it using this tool. Never use Base64 to 'secure' sensitive data like passwords or credit card numbers.

Why is there an equals sign (=) at the end?

The equals sign is used for 'padding'. Base64 mathematically requires the data chunks to align to a specific size (divisible by 4). If your input text doesn't fit perfectly, the encoder adds one or two equals signs to pad out the remaining space.

What is URL-safe Base64?

Standard Base64 uses the '+' and '/' characters, which have special structural meanings in URLs and can break web links. URL-safe Base64 simply replaces the '+' with a hyphen '-' and the '/' with an underscore '_', making the string perfectly safe for web routing.

Why did I get an error when decoding?

Errors usually occur if the string you pasted is not actually Base64. If the text contains invalid characters (like !, @, or ?), or if a piece of the string was cut off before you pasted it, the mathematical decoding process will fail.