Base64 Encoder and Decoder

The Base64 encoder and decoder converts text to Base64 format or decodes any Base64 string back to plain text, entirely in your browser. Used daily for JWT tokens, data URI encoding, HTTP Basic Authentication headers, and API payload inspection. Free, nothing uploaded to any server.

INPUT — Plain text
OUTPUT — Base64 encoded
Quick examples
Hello, World!SGVsbG8sIFdvcmxkIQ==
user:passworddXNlcjpwYXNzd29yZA==
{"key":"val"}eyJrZXkiOiJ2YWwifQ==

How to encode and decode Base64 online

Paste your text into the input field and click Encode to get the Base64 representation. Paste a Base64 string and click Decode to get the original text. The base64 encode online operation converts each group of three bytes in your input to four Base64 characters using the standard A-Z, a-z, 0-9, +, / character set. The output length is always a multiple of 4 characters, padded with = signs if necessary.

A common use case for encode to Base64 is creating HTTP Basic Authentication headers. The format is Base64-encode the string "username:password" and prepend "Basic " to the result. Use this tool to generate the header value locally without sending your credentials to any intermediate service. JWT tokens contain a Base64-encoded payload section between the first and second dot, paste just that section into the decoder to read the claims without any JWT library.

Base64 decoder: when and why to decode

The Base64 decoder converts Base64 strings back to their original text. Decoding is necessary when inspecting JWT payloads during debugging, reading data URIs embedded in HTML or CSS, interpreting API responses that use Base64 encoding for binary-safe transmission, and auditing encoded values in configuration files. The decode base64 string operation is the exact inverse of encoding: every 4 Base64 characters map back to 3 bytes of original data.

URL-safe Base64 uses - and _ instead of + and / to make the string safe for use in URLs without percent-encoding. If you are decoding a URL-safe Base64 string and getting an error, replace - with + and _ with / before pasting. Most JWT libraries and OAuth implementations use URL-safe Base64 without padding. This decoder handles both standard and URL-safe variants.

Frequently asked questions

Base64 encoding converts binary data into a text-safe format that can pass through systems designed to handle text. In web development it is used for JWTs (JSON Web Tokens) to encode the header and payload, for data URIs to embed images or fonts directly in HTML and CSS, for HTTP Basic Authentication headers that combine username and password, and for encoding binary API response payloads for text-based transport.

Paste the Base64 string into the input field and click Decode. The tool converts every group of four Base64 characters back to three bytes of original data. The decoded output appears in the result field and can be copied. If the Base64 string uses URL-safe characters (- and _ instead of + and /), the decoder handles both variants automatically.

Yes. Base64 can encode any binary data including images, fonts, PDFs, and binary files. The encoded output is a text string 33 percent longer than the original data. For images, this produces a data URI that can be used directly in an img src attribute or CSS background-image. Enter a data URL into this tool to decode and inspect the header. Full binary file encoding requires the file upload variant of this tool.

No. Base64 is an encoding scheme, not an encryption method. It converts data to a different representation but applies no secret key and provides no confidentiality. Any Base64 string can be decoded by anyone with access to it. Do not use Base64 to obscure sensitive data. If you need to protect data, use actual encryption with a secret key. The text encryptor on this site provides XOR cipher-based encryption for lightweight obfuscation.

Related tools