What is base64 encoder and decoder?
Base64 is used to carry binary data inside text based systems, such as emails, JSON and data URLs. It makes data about one third larger.
This tool supports Unicode text, so accented letters and emoji encode and decode correctly.
How to use the base64 encoder and decoder
- Pick encode or decode.
- Paste your input.
- Press Calculate and copy the output.
How the base64 encoder and decoder works
Text is converted to UTF 8 bytes and the bytes are mapped to the 64 character Base64 alphabet in groups of three, with equals signs added as padding.
Worked example
Common uses of the base64 encoder and decoder
- Embedding a small image or font directly in CSS or HTML.
- Reading the payload of a token or an email header while debugging.
- Sending binary data inside JSON or XML.
- Decoding a Base64 string copied from a log.
- Learning how binary to text encoding works.
Tips and common mistakes
Base64 is not encryption. Anyone can decode it, so never use it to hide secrets.
URL safe Base64 swaps plus and slash for minus and underscore. Replace them before decoding if needed.
Background: what to know before you rely on it
Many older protocols, such as email, were designed for plain text. Base64 solves the problem of sending binary files through them by using only 64 safe characters: capital and lowercase letters, digits, plus and slash. Every three bytes become four characters, so data grows by about a third. The equals sign at the end pads the last block. A URL safe variant swaps plus and slash for minus and underscore. Base64 is an encoding and not encryption. Anyone can decode it, so passwords and secrets must never be protected by it alone.
Private, free and fast
This tool runs entirely in your browser. What you type or choose is not uploaded to a server and is not saved after you close the page, which keeps it fast and private. It is free to use as often as you like. See more in all developer tools, or browse the full list of tools.
Frequently asked questions
What is Base64?
A way to represent binary data using 64 printable characters.
Is Base64 secure?
No, it only changes the format.
Why does decoding fail?
The input may contain characters outside the Base64 alphabet or be cut short.
Related tools
JSON Formatter and Validator
Paste your JSON and the tool checks that it is valid, then formats it with indentation or compresses it...
Developer ToolsURL Encoder and Decoder
URL encoding replaces unsafe characters with a percent sign and two hex digits so a link works...
Developer ToolsHash Generator
A hash is a fixed length fingerprint of your text. Enter text to get its SHA 1, SHA 256, SHA 384 and SHA...
Developer ToolsRegex Tester
Enter a pattern, flags and test text. The tester lists every match with its position and capture groups...
SEO ToolsMeta Tag Generator
Enter your page title, description and URL and the generator writes the HTML meta tags, including Open...
GeneratorsLorem Ipsum Generator
Choose how many paragraphs, sentences or words you need and the generator returns placeholder text you...
Results are for information and education. For legal, financial, medical or security decisions, check with a qualified professional. Do not paste live secrets into any website.