Base64 Encode and Decode
Encode text for an HTTP header, a data URI or a config value, or decode a Base64 string to see what is inside. Emoji and accented letters survive the round trip.
- Free
- Runs in your browser
- UTF-8 safe
- No sign-up
How It Works
Convert in three steps.
Pick a direction
Encode turns text into Base64, Decode turns Base64 back into text.
Paste your input
The result appears as you type.
Copy the result
Switching direction moves the result to the input, so you can check a round trip.
What is Base64 encoding?
Base64 writes any bytes using only 64 safe characters: A-Z, a-z, 0-9, + and /. It is used wherever binary data or special characters must travel through a channel built for plain text, such as email attachments, HTTP Basic authentication headers, data URIs and JSON fields. Every 3 bytes become 4 characters, so the result is about a third larger than the input.
Base64 is an encoding, not encryption. Anyone can decode it, so never use it to hide a password or a secret.
UTF-8 first
Text is converted to UTF-8 bytes before encoding, so é, ü, 中 and emoji decode correctly anywhere.
URL-safe variant
Uses - and _ instead of + and / and drops the = padding, as JWTs and many URL parameters expect.
Forgiving decoder
Accepts line breaks, missing padding, URL-safe characters and a data: URI prefix.
Binary detection
If the decoded bytes are not text, such as an image, you can download them as a file.
Convert PDF Files and File Formats
Find the perfect online tool to combine PDF files, compress documents, and handle your daily workflow effortlessly.
PDF Tools
All your PDF needs in one place
- Merge PDF
- Organize PDF
- Split PDF
- Compress PDF
- Convert to Word
- Convert to Image
Image Tools
Edit and optimize your images
- Resize Image
- Compress Image
- Convert Format
- Crop Image
- Add Watermark
- Remove Background
Word Tools
Work with Word documents
- Convert to PDF
- Merge Documents
- Split Documents
- Compress File
- Edit Text
- Add Watermark
Excel Tools
Process Excel spreadsheets
- Convert to PDF
- Convert to CSV
- Merge Sheets
- Split Sheets
- Compress File
- Clean Data
Why Use This Base64 Tool
Both directions, done properly.
Handles every language
Some online encoders break on non-English text. This one encodes UTF-8 correctly.
Round-trip check
Switch direction and the result becomes the input, so you can confirm it decodes back.
Decodes files too
Got a Base64 image or PDF? Decode it and download the original file.
Private
Tokens and credentials you decode stay in your browser.
Frequently Asked Questions
Questions people ask about the Base64 encoder and decoder.
The original was probably encoded from a different character set, such as Windows-1252, or the data is not text at all. If the tool detects binary data, it offers a download instead of showing it.
Standard Base64 uses + and /, which have meanings in URLs. URL-safe Base64 replaces them with - and _ and usually omits the = padding. JWTs and many APIs use it. The decoder reads both kinds.
Base64 works on groups of 3 bytes. When the input does not divide evenly, = signs pad the last group to 4 characters. The decoder adds them back if they are missing.
Use the Image to Base64 tool, which reads the file and gives you a data URI. This page is for text.
Related Text & Developer Tools
More small utilities that run in your browser.
JWT Generator
Create and sign HS256, HS384 or HS512 test tokens.
URL Encode & Decode
Percent-encode text for URLs or decode it.
JWT Decoder
Read the header and payload of a JSON Web Token.
HTML Entity Encode & Decode
Escape HTML special characters or turn entities back into text.
Hash Generator
Make MD5, SHA-1, SHA-256 and SHA-512 hashes of text.