nicetool.dev logo

BASE64 ENCODER

Everything is processed in your browser. Your data never leaves your computer.

Input Source
Result

What is Base64?

Base64 is a group of binary-to-text encoding schemes that represent binary data in an ASCII string format by translating it into a radix-64 representation. It allows binary data (like images or files) to be transported over channels that are designed to handle text reliably.

How Base64 Works

Base64 works by splitting the input binary data into 24-bit groups (3 bytes). These groups are then divided into four 6-bit chunks. Each 6-bit value is mapped to a specific character in the Base64 alphabet (A-Z, a-z, 0-9, +, /). If the data length isn't divisible by 3, the '=' character is added as padding.

3 Bytes (24 bits) → 4 Chars (6 bits each)

Encoding vs. Encryption

A common misconception is that Base64 secures data. Base64 is Encoding, NOT Encryption. Base64 strings can be decoded by anyone without a key or password. Therefore, never use Base64 alone to store passwords or sensitive secrets.

Base64 ≠ Password Protection

Common Use Cases

  • Data URIs: Embedding images or icons directly into HTML/CSS to reduce HTTP requests.
  • Email Attachments (MIME): Safely transmitting binary files over legacy text-based SMTP protocols.
  • APIs & JSON: Transmitting binary data (like PDFs or images) inside JSON payloads.

Why is this tool secure?

Unlike many server-side tools, Nicetool.dev operates on a 'Local-first' architecture. We use your browser's capabilities to handle all encoding and decoding tasks.

Your data is NEVER sent to our servers.

How to use the Base64 Encode/Decode

  1. 1

    Choose Encode to turn text into Base64, or Decode to turn a Base64 string back into readable text.

  2. 2

    Paste your input. Keep the character set on UTF-8 for text with accents, emoji or Asian scripts; choose ASCII only for plain English legacy data.

  3. 3

    With Live Mode on, the result updates as you type. Turn it off and press GO! when you work with large inputs.

  4. 4

    Copy the result. If decoding fails, the input probably contains characters outside the Base64 alphabet or was cut off, so check that you copied the whole string.

Practical examples

HTTP Basic authentication

The Authorization header for user admin and password s3cret is "Basic " followed by the Base64 of "admin:s3cret", which is YWRtaW46czNjcmV0. Decoding a header from a log shows which user was sent.

Kubernetes secrets

Values in a Secret manifest are Base64 encoded. Decode them to check a database URL, or encode a new value before pasting it into the YAML file.

Data URIs

Small icons can be embedded in CSS or HTML as data:image/png;base64,... so the browser needs one request less.

Inspecting tokens and payloads

Webhook signatures, email attachments (MIME) and parts of a JWT all use Base64. Decoding them is often the first step when debugging an integration.

Frequently asked questions

Is Base64 encryption?+

No. Base64 is an encoding that anyone can reverse without a key. It makes binary data safe to send over text-based channels, but it does not hide or protect the content. Use real encryption for secrets.

Why is the Base64 output longer than the input?+

Base64 represents every 3 bytes with 4 characters, so the result is about 33% larger. The = signs at the end are padding that fills the last group.

What is Base64URL?+

A variant that replaces + with - and / with _ and usually drops the = padding, so the result can be used in URLs and file names. JWTs use Base64URL.

Why do accented characters decode incorrectly?+

The text was probably encoded with a different character set. Most modern systems use UTF-8, so choose UTF-8 on both sides to keep characters like é or ữ intact.