Skip to main content
UFOZoo

Base64 Encoder/Decoder: Encode & Decode Text Online

Base64 encoder and decoder online: encode and decode text and files with full UTF-8 support and copy-ready output for data transfer.

Updated 2026-08-16

Related Tools

Features

  • Real-time auto-detection: just paste text or Base64 and the tool figures out the direction instantly
  • Smart mode toggle: switch between Auto (recommended), Encode, or Decode with one click
  • Full UTF-8 support: correctly handles emojis (🚀), Chinese (中文), Japanese (日本語), accented letters (é), and any Unicode characters
  • Instant conversion: results update as you type, no button to press
  • Drag-and-drop files: drop .txt or .base64 files anywhere on the workspace, or click the open icon
  • One-click copy: copy the result to your clipboard with visual confirmation feedback
  • Save as file: save the result as a .txt file for sharing or storage
  • Clear input: one-click to reset everything and start fresh
  • Character count and file size: real-time stats displayed in the status bar

How to Use

  1. 1Paste your text or Base64 string into the input area. The tool instantly detects the format and converts it automatically.
  2. 2If auto-detection doesn't match what you need, click Encode or Decode in the mode bar to manually set the direction.
  3. 3Open a file by clicking the folder icon and selecting a .txt or .base64 file, or drag and drop a file directly onto the workspace.
  4. 4Review the result in the output area below. Click Copy to copy it to your clipboard, or Save to save it as a .txt file.
  5. 5Click the Clear button (trash icon) to reset everything and start a new conversion.
  6. 6Use the example buttons below the input area to load sample data and see how the tool works.
  7. 7Encode a JSON Web Token (JWT) payload to Base64 for inspection; paste the header or payload section to see the decoded content.
  8. 8Decode a Base64-encoded API key or access token to verify its format and structure before using it in your application.
  9. 9Open a .txt file containing Base64 data and switch to Decode mode to instantly convert the entire file back to readable text.
  10. 10Use the character and line counters to estimate the encoded output size before sending it over a network with bandwidth constraints.

Frequently Asked Questions

What is Base64 encoding used for?

Base64 encoding converts binary data into ASCII text using 64 printable characters. It's commonly used for embedding images in HTML/CSS (data URIs), transmitting binary data in JSON APIs, storing binary data in text-based formats like XML, encoding email attachments (MIME), and passing data through URL query parameters safely. It's everywhere in web development.

Is Base64 secure? Can it encrypt my data?

No. Base64 is an encoding scheme, not encryption. Anyone can decode Base64 back to the original data using freely available tools, including this one. Do not use Base64 to protect sensitive information like passwords, credit card numbers, or personal data. For security, use proper encryption algorithms like AES or RSA.

How do I encode or decode Base64 in Python, Java, or JavaScript?

This is a browser tool and does not generate code, but the one-liners are simple: Python: base64.b64encode(s.encode()).decode() to encode, base64.b64decode(s).decode() to decode; Java: java.util.Base64.getEncoder().encodeToString(bytes) and getDecoder().decode(str); JavaScript in the browser: btoa()/atob() (UTF-8 text needs a UTF-8-safe wrapper like TextEncoder/TextDecoder), or Buffer.from(str).toString('base64') in Node. For quick checks, paste the value here instead.

Does this tool work offline?

Yes. Every encode/decode operation runs entirely in your browser, so once the page is loaded you can disconnect from the internet and the tool keeps working. There is nothing to download or install; just keep the page open.

Does this tool support UTF-8 and special characters?

Yes. The tool correctly handles all Unicode characters including emojis (🚀, 🌟, ❤️), Chinese characters (中文), Japanese (日本語), Korean (한국어), accented letters (é, ü, ñ), and any other UTF-8 encoded text. Most basic Base64 tools break on non-ASCII characters; this one is built specifically to handle them correctly.

What's the difference between Base64, Base64URL, and Base32?

Base64 uses A-Z, a-z, 0-9, +, and / with = for padding. Base64URL is a variant that replaces + with - and / with _ for safe use in URLs and filenames. Base32 uses A-Z and 2-7 (32 chars) and produces longer output but is more human-readable. Standard Base64 is the most widely used format; this tool uses standard Base64 (RFC 4648).

What does the = padding at the end of Base64 mean?

The = sign is padding added to make the Base64 output length a multiple of 4. One = means the original data had 2 bytes of padding, two == means 1 byte of padding. Some systems accept Base64 without padding (sometimes called unpadded Base64). This tool handles both padded and unpadded Base64 when decoding.

Can I open files for encoding?

Yes. You can open .txt files (or any text-based file) to encode their content as Base64. Click the folder icon in the input toolbar to select a file, or drag and drop a file directly onto the workspace. For binary files like images or PDFs, the file content will be read as text; for proper binary-to-Base64 conversion, use a dedicated image-to-Base64 tool.

Is there a file size limit?

There's no strict limit enforced by the tool, but browser performance may degrade with very large inputs (10 MB+). Since all processing is client-side, the practical limit depends on your device's available memory. For most use cases (encoding API keys, tokens, configuration values, or short documents), performance is instant.

How is Base64 different from hexadecimal encoding?

Base64 encodes binary data using 64 printable characters and is more space-efficient than hex (33% overhead vs 100%). A 3-byte input becomes 4 Base64 characters but 6 hex characters. Base64 is preferred for transmission in text protocols; hex is preferred for human-readable debugging.

Can I decode a JWT token with this tool?

Yes, but only the header and payload sections of a JWT are Base64-encoded JSON. The signature is binary. Paste the first or second section of your JWT (between the dots) and this tool will decode the Base64 to reveal the JSON content. Use Decode mode for this.

Why does my Base64 encoded string contain line breaks?

Some systems insert line breaks every 76 characters (MIME standard) for readability. The tool handles both formats: it strips line breaks during decoding and generates continuous output during encoding. You can paste multi-line Base64 and it will decode correctly.

The decoded output is garbled characters: what did I do wrong?

Check the input first: if what you pasted is not actually Base64 (it contains characters outside A–Z, a–z, 0–9, +, / and =, like spaces or Chinese), there is nothing to decode, that is plain text or another encoding. Other common causes: the string was encoded twice, URL-encoded before Base64 (run a URL percent-decoder on it first), or the original data was binary (an image or compressed file) that only looks like text once decoded. Note that this tool uses standard Base64 (RFC 4648): if you need URL-safe output, replace + with - and / with _ yourself, or use a dedicated Base64URL encoder.

Is there an app or browser extension I should install for this?

No. This page is the tool itself, and it works fully offline once loaded, so there is nothing to install. If you mostly work on your phone, any Base64 app from your app store does the same job; on desktop, bookmark this page or pin it to your home screen for one-click access.