Base64 Encoder / Decoder
Encode text to Base64 or decode Base64 strings back to plain text. Paste your content and convert.
How to use
Paste your text in the input area and click Encode to convert it to Base64, or paste a Base64 string and click Decode to convert it back to plain text. Use the Copy button to copy the result to your clipboard.
What is Base64?
Base64 is a binary-to-text encoding scheme that represents binary data as an ASCII string. It is commonly used for embedding images in HTML/CSS, encoding email attachments (MIME), transmitting data in URLs and APIs, and storing binary data in JSON or XML. Each Base64 character represents 6 bits of data, so encoded output is approximately 33% larger than the original.
When this tool helps
Developers, system administrators, and security professionals regularly need to encode or decode Base64 data. Whether you are debugging an API response that contains Base64-encoded payloads, embedding a small image directly into HTML or CSS as a data URI, decoding email attachment headers, or working with JSON Web Tokens (JWTs), this tool provides conversion without installing any software. Everything runs in your browser, so sensitive data like tokens or credentials never leaves your device.
Examples
Example 1: Decoding a JWT Token
A developer receives a JWT like "eyJhbGciOiJIUzI1NiJ9" and needs to inspect its payload. Pasting the middle section into the decoder reveals the JSON claims: {"sub":"1234","name":"John"}. This is useful for debugging authentication issues without needing a dedicated JWT tool.
Example 2: Embedding an Image in CSS
A front-end developer has a small 2KB icon and wants to inline it in CSS to save an HTTP request. They encode the image file to Base64, then use it as: background-image: url(data:image/png;base64,iVBOR...). This eliminates a network round trip for tiny assets.
Example 3: API Authentication Header
An API requires Basic Authentication with credentials encoded as Base64. The developer encodes "username:password" to get "dXNlcm5hbWU6cGFzc3dvcmQ=" and places it in the Authorization header. This tool lets them quickly verify the encoding is correct before sending the request.
Things to watch
- •Base64 is not encryption, never use it to "hide" sensitive data. Anyone can decode Base64 strings trivially.
- •If your decoded output looks garbled, the original data may be binary (like an image) rather than text, this tool works best with text content.
- •Watch for line breaks in Base64 strings, some systems wrap at 76 characters (MIME standard), which can cause decode errors if not handled.
- •Padding characters (= or ==) at the end of Base64 strings are normal, they fill the output to a multiple of 4 characters.
- •For URL-safe Base64, replace + with - and / with _ before using encoded data in URLs or query parameters.
Common questions
- What is Base64 encoding?
- Base64 is a binary-to-text encoding scheme that converts any binary data into a text string using 64 safe ASCII characters (A-Z, a-z, 0-9, +, /). It allows binary data to be safely transmitted or stored in systems that only handle text.
- Why is Base64 used?
- Base64 is used for embedding images in HTML/CSS, encoding email attachments, transmitting data in URLs and APIs, and storing binary data in JSON or XML formats. It ensures binary data can safely travel through text-only systems without corruption.
- Does Base64 encrypt data?
- No, Base64 is an encoding scheme, not encryption. It converts data to a different format but is easily reversed; anyone who knows about Base64 can decode it. For actual security, use encryption algorithms like AES after (or instead of) Base64 encoding.
- Why is Base64 output about 33% larger than the input?
- Base64 uses 6 bits per character instead of the usual 8 bits per byte. To encode 3 bytes (24 bits) of data, you need 4 Base64 characters. This 4:3 ratio means the output is always approximately 33% larger. Plus, padding characters (=) may be added to make the output length a multiple of 4.
- What is the difference between Base64 and Base64URL?
- Standard Base64 uses + and / characters, which have special meaning in URLs. Base64URL replaces + with - and / with _ to make the output safe for use in URLs, filenames, and query parameters without additional encoding. Most modern APIs use Base64URL for tokens and identifiers.