Base64 Encoder & Decoder
Fast, privacy-focused Base64 encoding and decoding tool. Encode string inputs to UTF-8 Base64 strings or decode Base64 outputs effortlessly.
Step-by-Step Instructions
Input Text, Hex, or File
Paste plain UTF-8 text, hexadecimal data, or upload an image/binary file.
Select Mode (Encode or Decode)
Choose Base64 Encode to generate ASCII Base64 strings, or Base64 Decode to restore original text or binary.
Configure Encoding Format
Select Standard Base64 (RFC 4648) or URL-Safe Base64 (replacing `+` and `/` with `-` and `_`).
Copy or Download Converted Output
Copy converted Base64 text or download decoded binary files directly.
Key Features & Capabilities
- RFC 4648 standard Base64 encoding and decoding with full UTF-8 / Unicode character support
- URL-Safe Base64 variant support (`-` and `_` with optional padding stripping) for JWTs and URL parameters
- Base64 Data URI generator for embedding images, SVG, fonts, and CSS directly into HTML
- Binary file to Base64 and Base64 to binary file download support
Frequently Asked Questions
How does Base64 encoding work mathematically?
Base64 encoding takes binary data and splits it into 6-bit chunks (since $2^6 = 64$). Each 6-bit value (0 to 63) maps to an ASCII character in the standard 64-character alphabet: `A–Z` (0–25), `a–z` (26–51), `0–9` (52–61), `+` (62), and `/` (63). Three 8-bit bytes (24 bits total) are converted into four 6-bit Base64 characters, with `=` used as padding.
Why does Base64 encoding increase data size by 33%?
Because Base64 represents 3 binary bytes (24 bits) using 4 ASCII characters (32 bits), data size increases by exactly **33.33%** ($4/3 = 1.333$). Adding MIME line breaks and padding increases total overhead to approximately **37%**.
What is URL-Safe Base64 (Base64URL) and where is it used?
Standard Base64 contains `+`, `/`, and `=` characters, which have special reserved meanings in URLs and query strings. **URL-Safe Base64 (RFC 4648 §5)** replaces `+` with hyphen (`-`), replaces `/` with underscore (`_`), and omits trailing `=` padding, making it safe for JSON Web Tokens (JWT) and URL paths.
What is a Base64 Data URI in web development?
A Data URI allows small media assets (images, icons, fonts) to be embedded inline in HTML/CSS without making extra HTTP requests: `data:image/png;base64,iVBORw0KGgo...`. This reduces HTTP roundtrips for tiny SVGs and icons.
Related Utilities
Discover complementary online tools in the same workflow.
JSON Formatter & Validator
Format, beautify, minify, validate, and view JSON data online with instant syntax highlighting and error detection.
CSV to JSON Converter
Easily convert CSV data to clean JSON format. Turn tabular spreadsheets into structured JSON.
YAML to JSON Converter
Convert YAML configuration files into structured JSON for APIs and modern web tooling.
JWT Parser & Token Debugger
Decode JWT tokens to view header, payload claims, and expiration status without sending secrets anywhere.
Hash Generator (SHA-256, SHA-512, MD5)
Generate cryptographically secure SHA-256, SHA-512, SHA-384, and SHA-1 hashes for any text.
Color Contrast Checker (WCAG)
Check color contrast ratios for WCAG 2.1 AA and AAA accessibility compliance and ADA standards with live UI preview.