</>CodeKitHub中文

Base64 Encoder / Decoder Online

Convert text to Base64 or decode a Base64 string back to readable text. This tool is UTF-8 safe, so it correctly handles emoji, Chinese, and other non-ASCII characters that break naive Base64 tools. Everything runs locally in your browser.

What Is This Tool?

Base64 is an encoding scheme that converts binary or text data into a set of 64 safe ASCII characters (A–Z, a–z, 0–9, + and /). It is used everywhere in software: embedding images in HTML/CSS, HTTP Basic authentication headers, email attachments (MIME), JSON Web Tokens, and API payloads that must survive text-only channels.

Important: Base64 is an encoding, not encryption. Anyone can decode it. Its purpose is to make data safe to transmit through systems that only understand text — not to keep it secret.

Why Use It?

  • Decode API tokens, JWT segments and auth headers to see what's inside.
  • Encode text for data URIs, config files or HTTP headers.
  • UTF-8 safe: emoji and non-Latin characters encode and decode correctly.
  • 100% private — the conversion happens in your browser, nothing is uploaded.
  • Free, no login, no size limits.

How to Use

  1. Type or paste your content into the input box.
  2. Click "Encode" to convert text to Base64, or "Decode" to convert Base64 back to text.
  3. If decoding fails, the input isn't valid Base64 — check for missing characters or extra whitespace.
  4. Click "Copy" to copy the result.

Example

Input

Hello, CodeKitHub! 你好 👋

Output

SGVsbG8sIENvZGVLaXRIdWIhIOS9oOWlvSDwn5GL

Note how the Chinese characters and the emoji survive the round trip — that's the UTF-8 safe part.

Frequently Asked Questions

Is Base64 encryption?

No. Base64 is a reversible encoding that anyone can decode — it provides zero security. If you need to protect data, use real encryption (like AES); Base64 is only for making data safe to transport as text.

Why does my decoded output look like garbage?

Either the input isn't actually Base64, it's been truncated, or the original data was binary (like an image) rather than text. Binary data won't display as readable characters.

What are the = signs at the end?

Padding. Base64 works in blocks of 3 input bytes → 4 output characters. When the input length isn't divisible by 3, one or two = characters pad the final block.

Does this tool work with emoji and Chinese characters?

Yes. It encodes text as UTF-8 bytes first, which is the standard approach. Naive tools that use btoa() directly fail on any character outside Latin-1 — this one doesn't.

Is my data uploaded anywhere?

No. Encoding and decoding run entirely in your browser with JavaScript. Your data never leaves your device.

Related Tools