DEVELOPER TOOLS

Base64 Encoder and Decoder

Encode any text to Base64 or decode a Base64 string back to readable text. Full UTF-8 support, and nothing leaves your browser.

Everything happens on your device. Your inputs and files are never sent to a server.

Base64 shows up everywhere in development: Basic Authentication headers, Kubernetes secrets, email attachments, data URIs and API fields that need to carry text safely through systems built for plain ASCII. This tool converts text to Base64 and Base64 back to text. Unlike the browser's built-in btoa(), which fails on characters outside Latin-1, it first encodes your input as UTF-8, so accented letters, non-Latin scripts and emoji round-trip without corruption.

Decoding is just as strict as it should be. The tool accepts standard Base64 with the + and / alphabet and the required = padding, ignores line breaks and spaces, and confirms that the decoded bytes form valid UTF-8 text before showing them. Everything runs in your browser, so the encoded credentials or tokens you inspect are never uploaded.

How to use: Base64 Encoder and Decoder

  1. In the Operation menu, choose Text → Base64 to encode or Base64 → UTF-8 text to decode.
  2. Paste your input into the text field, or press Load sample to try an example with accents and emoji.
  3. Press Convert. The encoded or decoded result appears in the Result panel along with its size in bytes.
  4. If you see an error, check that the Base64 is complete and padded, or that it actually contains text.
  5. Press Copy to use the result elsewhere or Download to save it as a .txt file.
EXAMPLE

Example: Hello, café! encodes to SGVsbG8sIGNhZsOpIQ== and decodes back unchanged.

Why Base64 output is about 33% larger

Base64 represents binary data using 64 safe characters: A–Z, a–z, 0–9, + and /. Each character carries 6 bits, so every 3 input bytes (24 bits) become 4 output characters. That 4:3 ratio is where the familiar 33% size increase comes from. When the input length is not a multiple of three, the final group is completed with one or two = signs so the output length is always a multiple of four.

Non-ASCII characters take more than one UTF-8 byte (é uses two, most emoji four), so text with emoji yields longer Base64 than its character count suggests.

Common decoding errors

Two error messages cover almost every failed decode. Knowing which one you got tells you where to look.

  • Enter valid, standard Base64 text: the input contains characters outside the standard alphabet, has a missing or extra = sign, or was cut off while copying.
  • URL-safe Base64: strings using - and _ instead of + and /, common in JWTs and URLs, are not accepted directly. Replace - with + and _ with /, then add = until the length is a multiple of four.
  • The Base64 content is not valid UTF-8 text: the string decodes to binary data, such as an image, PDF or encrypted blob, rather than readable text.

Typical use cases

This tool works with text. It does not convert files or images to Base64; for that, use your language's standard library or a command such as base64 on macOS and Linux.

  • Reading the username and password inside an HTTP Basic Authorization header while debugging.
  • Checking or preparing values for Kubernetes Secret manifests, which store data as Base64.
  • Inspecting the payload segment of a JWT after converting it from URL-safe Base64.
  • Embedding short text values in JSON, XML or environment variables without escaping issues.

Base64 is encoding, not encryption

Anyone can decode Base64 in seconds, so it provides no confidentiality. A Kubernetes secret or a Basic Auth header is only as protected as the TLS connection and storage around it, so never use Base64 to hide passwords. Because this tool decodes locally, inspecting such a value here does not send it to a third-party server, but do not paste decoded credentials into tickets or chats.

Frequently asked questions

How do I decode Base64 to text?

Choose Base64 → UTF-8 text in the Operation menu, paste the Base64 string and press Convert. Spaces and line breaks are ignored, so wrapped output from email or command-line tools works fine. The result appears as readable text. If the data turns out to be binary, the tool tells you instead of showing garbled characters.

Does it support UTF-8, accents and emoji?

Yes. Before encoding, the tool converts your text to UTF-8 bytes, which is the encoding used by virtually all modern APIs and web pages. Characters like ñ, ü, Ç, Chinese and Arabic script, and emoji encode and decode correctly. This avoids the "character out of range" error you get from calling btoa() directly on non-Latin text.

Why do I get an invalid Base64 error?

The decoder expects standard Base64: only A–Z, a–z, 0–9, + and /, with = padding so the length is a multiple of four. Errors usually mean the string was truncated, contains URL-safe characters (- and _), or lost its trailing = signs. Restore the padding or convert URL-safe characters, then try again.

Can I decode a JWT with this tool?

Not directly. JWT segments use URL-safe Base64 without padding, which this decoder does not accept as is. Copy the middle segment, replace - with + and _ with /, add = signs until the length is divisible by four, and then decode it. Remember that decoding a JWT only reveals its claims; it does not verify the signature.

Can I convert an image or file to Base64?

No, this tool works with text only. It encodes text you type or paste, and decodes Base64 that represents UTF-8 text. For images, PDFs or other files, use a command like base64 on macOS or Linux, certutil -encode on Windows, or the encoding functions in your programming language.

Cookie and ad preferences

Your favorites and theme preference are stored on your device. Tool inputs are never saved. Ads load only when the consent management integration allows them.

No consent management platform is connected on this installation, so no ad requests are sent.