Pinatool

Base64 Encoder & Decoder

Convert UTF-8 text and binary files to standard Base64, URL-safe Base64, or Data URLs, and decode Base64 strings back into readable text or downloadable files.

RFC 4648 · URL-Safe · Data URL·Up to 20.0 MB

Source to encode

Enter UTF-8 text or choose a binary file to convert into Base64.

Encoding estimate

Source: 84 B → Encoded: ~112 B (+33%)

How It Works

1

Choose Mode & Input

Select Encode or Decode mode, then enter UTF-8 text or select any file up to 20 MB.

2

Select Output Format

Switch between standard RFC 4648 Base64, URL-safe Base64, or complete Data URLs with MIME headers.

3

Copy Output or Download File

Copy the encoded string with one click, or preview and download decoded binary files with their detected file extension.

Base64 Encoder & Decoder Key Features

UTF-8 Text & Binary File Encoding

Encode international characters, emojis, documents, images, and archives into standard Base64 without character corruption.

Smart Decoding & File Detection

Automatically validates Base64 strings, detects PNG, JPEG, GIF, WebP, SVG, PDF, and UTF-8 text signatures, and prepares downloadable files.

Standard, URL-Safe & Data URL Formats

Export RFC 4648 Base64, URL-safe strings for query parameters and JWTs, or ready-to-embed HTML and CSS Data URLs.

Frequently Asked Questions

Is Base64 secure for hiding sensitive data?

Base64 is a binary-to-text encoding scheme, not encryption. Anyone can decode a Base64 string back to its original bytes without a key or password, so it should never be used on its own to protect secrets.

What is the difference between standard Base64 and URL-safe Base64?

Standard Base64 (RFC 4648 §4) uses '+' and '/' characters and '=' padding, which have special meanings in URLs and file paths. URL-safe Base64 (RFC 4648 §5) replaces '+' with '-' and '/' with '_' and omits trailing '=' padding so strings can be placed safely in URLs, query parameters, and JWT tokens.

How do I use a Base64 Data URL in HTML or CSS?

Select the "Data URL" output format to generate a string starting with data:<mime-type>;base64,... You can paste this directly into an HTML <img src="..."> attribute or a CSS background-image: url("...") rule to embed small icons and assets inline.

Why does Base64 increase the size of my file by about 33%?

Base64 represents every 3 bytes (24 bits) of binary data as 4 ASCII characters (6 bits per character). That 4-to-3 ratio increases the encoded byte size by approximately 33% compared to the original file.

Can this tool decode Data URLs and unpadded Base64 strings?

Yes. In Decode mode, you can paste standard Base64, URL-safe Base64, multiline MIME-wrapped Base64, unpadded strings, or full data:mime;base64,... URLs. The decoder automatically extracts the payload, identifies the MIME type, and lets you preview or download the reconstructed file.