Developer Tools

Base64 Encoder & Decoder Online

Encode UTF-8 text with standard Base64 or Base64URL, or decode either format back into readable text. Validate API payloads, authentication-header values, and JWT segments with processing that runs locally in your browser.

UTF-8 Support
Instant Conversion
Copy Output
Client-Side Only
Developer Friendly
Mobile Compatible

Base64 Encoding Example

Original Text

NVR Nexus

Base64 Encoded

TlZSIE5leHVz
Base64 variantVariant

Uses + and / with optional trailing = padding. Whitespace inside decoded input is ignored.

Plain Text Input
Base64 Output
Output appears here…

πŸ”’ 100% Client-Side Processing

Encoding and decoding run inside your browser using UTF-8 text conversion and native Base64 APIs. The tool does not send the entered text to an NVR Nexus processing server. Browser extensions, shared devices, clipboard history, and organizational policies can still affect confidentiality, so avoid pasting production passwords, private keys, live access tokens, or regulated data unless your organization permits it.


Common Base64 Use Cases

πŸ”‘

Basic Auth Headers

Encode username:password credentials for HTTP Basic Authentication headers used in REST APIs.

πŸ§ͺ

API Testing

Encode and decode request/response payloads when testing API endpoints with tools like Postman or cURL.

πŸ“¦

JSON Payload Transport

Encode JSON data for embedding inside URLs, HTML attributes, or systems that restrict special characters.

πŸ“§

Email MIME Encoding

Email systems use Base64 to encode attachments and non-ASCII characters in message bodies (RFC 2045).

πŸͺ™

JWT Token Inspection

Decode the header and payload segments of JSON Web Tokens to inspect claims and metadata.

πŸ–Ό

Data URI Generation

Convert images or fonts to Base64 for embedding directly into HTML or CSS as data: URIs.

βš™οΈ

Config File Storage

Represent non-secret binary configuration data or certificates as Base64 strings in YAML and JSON files.

πŸ”„

Binary-to-Text Conversion

Convert any binary data to a printable ASCII string safe for transmission over text-only protocols.


How Base64 Encoding Works

Base64 converts binary data into a set of 64 printable ASCII characters. The name comes from the number of characters in the encoding alphabet: 26 uppercase letters (A–Z), 26 lowercase letters (a–z), 10 digits (0–9), and two symbols (+ and /), totaling 64. A 65th character, the equals sign (=), is used as padding.

Every 3 bytes (24 bits) of input data are transformed into 4 encoded characters (each representing 6 bits). This is because 2⁢ = 64 β€” six bits can represent exactly 64 different values, corresponding to the 64-character alphabet. This 3-to-4 byte ratio is why Base64 encoding increases data size by approximately 33%.

Step-by-step: encoding "Man"

Input: M (77), a (97), n (110)

Binary: 01001101 01100001 01101110

Groups: 010011 | 010110 | 000101 | 101110

Decimal: 19 | 22 | 5 | 46

Output: T | W | F | u β†’ TWFu

This process allows data to travel safely through email systems, HTTP requests, APIs, and other text-based protocols without corruption. Systems that were designed for 7-bit ASCII can safely transmit Base64-encoded data that originally contained arbitrary binary values including null bytes and control characters.

Base64 in HTTP Basic Authentication

One of the most common developer encounters with Base64 is in HTTP Basic Authentication. When a server requires Basic Auth, the client encodes the credentials as username:password in Base64 and sends the result in the Authorization header:

// Credentials

admin:password123

// Base64 encoded

YWRtaW46cGFzc3dvcmQxMjM=

// HTTP Header

Authorization: Basic YWRtaW46cGFzc3dvcmQxMjM=

Security warning: Basic Auth credentials are only Base64-encoded, not encrypted. Always use HTTPS when transmitting Basic Auth headers to prevent credentials from being intercepted in plaintext.

Base64 URL Encoding vs Standard Base64

Standard Base64 uses + and / as the 62nd and 63rd characters. These characters can require escaping in URLs and form-encoded query values, while / also acts as a path separator. Base64URL replaces them with - and _.

Variant62nd char63rd charPaddingUsed In
Standard Base64+/= (required)Email (MIME), HTTP headers, general data encoding
Base64URL-_= (optional, often omitted)JWTs, OAuth tokens, URL parameters, filenames
Base64 MIME+/=, with line breaks at 76 charsEmail attachments (RFC 2045)

Base64 Encoding Across Programming Languages

Base64 encoding is natively supported in virtually every programming language. Here are the most common implementations:

JavaScript (Browser)
// Encode
btoa("Hello World")  // β†’ "SGVsbG8gV29ybGQ="

// Decode
atob("SGVsbG8gV29ybGQ=")  // β†’ "Hello World"
Python 3
// Encode
import base64
base64.b64encode(b"Hello World")  # β†’ b"SGVsbG8gV29ybGQ="

// Decode
base64.b64decode("SGVsbG8gV29ybGQ=")  # β†’ b"Hello World"
Node.js
// Encode
Buffer.from("Hello World").toString("base64")  // β†’ "SGVsbG8gV29ybGQ="

// Decode
Buffer.from("SGVsbG8gV29ybGQ=", "base64").toString()  // β†’ "Hello World"

Continue Your Developer Workflow

Inspect complete JSON Web Tokens with expiration and claim details using the JWT Decoder & Debugger, prepare percent-encoded query values with the URL Encoder & Decoder, turn a local image into a Data URI with the Image to Base64 Encoder, or calculate a checksum with the Hash Generator.

Technical References

The standard and URL-safe alphabets are defined in RFC 4648. HTTP Basic Authentication is defined in RFC 7617. Base64 represents bytes as text; neither standard makes the underlying information confidential.

Base64 Best Practices for Developers

Always use HTTPS when transmitting Base64-encoded credentials in Authorization headers β€” Base64 is encoding, not encryption.
For URLs and JWT tokens, use Base64URL encoding (replace + with -, / with _, and omit padding =) to avoid URL-encoding issues.
When encoding non-ASCII or Unicode text, always encode the UTF-8 byte representation of the text, not the raw character codes.
Don't use Base64 to 'hide' sensitive data in client-side code β€” it is trivially decodable by anyone who inspects your source.
For large binary files, consider chunked Base64 encoding to avoid memory issues. A 10 MB file becomes ~13.3 MB in Base64.
When decoding user-supplied Base64, always wrap in try/catch to handle invalid input gracefully without crashing.
Base64 encoded data URI format for images: data:image/png;base64,<encoded-data> β€” useful for small icons in CSS and HTML.

Frequently Asked Questions