Base64 Encoder & Decoder
Live UTF-8 encode · Hindi, emoji, and other Unicode stay intact · text stays in this tab
Image to Base64Max 1,048,576 chars
Online Base64 Encoder & Decoder
Looking for a Base64 encoder, Base64 decoder, or a place to Base64 encode and Base64 decode online? Toolshelf converts UTF-8 text in your browser — no signup and no uploads.
Paste text, choose Encode or Decode, and pick standard Base64 or Base64URL. Copy, swap, or download the result. Invalid Base64 shows a clear error instead of crashing.
What you can do with this Base64 tool
- Encode text to standard Base64 in your browser
- Decode Base64 back to readable UTF-8 text
- Unicode-safe encoding for Hindi, Gujarati, Chinese, Japanese, emoji, and accented letters
- Separate Standard Base64 and Base64URL modes
- Clear errors for invalid Base64 instead of a crash
- Copy, swap input/output, or download the result
- Private by design: input is not uploaded or stored
- Works on phones, tablets, and desktops
What is Base64?
Base64 is a way to represent binary data using 64 ASCII characters: A–Z, a–z, 0–9, plus + and /. Optional = characters pad the string to a multiple of four. Email systems, data URLs, and many APIs use it because the result is plain text.
Encoding is not encryption. A Base64 string can be decoded by anyone. Use it to transport or embed data, not to hide secrets.
What is Base64URL?
Base64URL is the same idea with a URL-safe alphabet. It replaces + with - and / with _, and it usually drops padding. JSON Web Tokens use Base64URL for each segment. Pasting a JWT segment into standard Base64 often fails because of those character differences — switch to Base64URL on this page, or use the JWT Decoder for a full token.
Unicode and why naive encoding breaks
JavaScript's btoa() and atob() work on binary strings, not on Unicode text. Calling btoa(unicodeText) throws for many characters. This encoder first turns your text into UTF-8 bytes, then Base64-encodes those bytes. Decoding reverses the same path with a fatal UTF-8 check so corrupted data is reported instead of silently garbled.
Common uses
Prepare API payloads
Encode a username, token fragment, or small JSON snippet to Base64 before putting it in a header, config, or test fixture.
Read encoded logs
Decode Base64 values copied from logs, emails, or support tickets without sending them to a third-party decoder.
Inspect JWT-style strings
Decode a single Base64URL segment when you only need the text, then open the JWT decoder if the value is a full token.
Check Unicode survival
Confirm that Hindi, Gujarati, emoji, or CJK text still round-trips after encoding — something naive btoa() usage often breaks.
Convert between alphabets
See the difference between standard Base64 (+ / =) and Base64URL (- _) on the same input.
Privacy-conscious encoding
Encode or decode on your device when you do not want to paste credentials or personal text into a hosted encoder.
How to encode or decode Base64
- 1Choose Encode or Decode, then Standard Base64 or Base64URL.
- 2Paste text or Base64. The result updates as you type. Use a Unicode sample if you want to confirm non-English text.
- 3Copy the output, swap the panels to reverse the last step, or download a
.txtfile.
Limits
- Input is capped at 1,048,576 characters so a huge paste cannot freeze the tab.
- Decoding expects UTF-8 text. Arbitrary binary that is not valid UTF-8 is rejected with an error. Convert pictures with the Image to Base64 Converter.
- Standard Base64 and Base64URL are not mixed automatically. If the alphabet does not match the selected mode, you will see a hint to switch.
Frequently asked questions
- What is a Base64 encoder?
- A Base64 encoder turns text or bytes into an ASCII string using 64 characters. This online Base64 encoder converts UTF-8 text in your browser so you can copy or download the result.
- What is a Base64 decoder?
- A Base64 decoder reverses encoding: it reads a Base64 string and reconstructs the original bytes, then this tool interprets those bytes as UTF-8 text. Invalid Base64 produces a clear error instead of a fake result.
- What is the difference between Base64 and Base64URL?
- Standard Base64 uses + and / and usually adds = padding. Base64URL replaces + with - and / with _ and typically omits padding so the string is safer in URLs and JWT parts. This page keeps the two alphabets separate.
- Does this Base64 tool support Unicode?
- Yes. Text is converted to UTF-8 bytes before encoding, then decoded back with a UTF-8 decoder. Hindi, Gujarati, Chinese, Japanese, emoji, and accented characters round-trip correctly. The tool does not pass raw Unicode to btoa().
- Why does btoa() fail on some text?
- The browser btoa() function expects a binary (Latin-1) string. Many Unicode characters are outside that range, so btoa("नमस्ते") or btoa("👋") throws. Encode UTF-8 bytes first, then Base64-encode those bytes.
- Do I need an account to use this Base64 encoder?
- No. Toolshelf Base64 Encoder & Decoder requires no account and no uploads.
- Does this Base64 decoder send my text to a server?
- No. Toolshelf encodes and decodes locally in your browser. Input is not uploaded, not written to localStorage, and not placed in the page URL.
- What happens if I paste invalid Base64?
- You get a readable error — invalid characters, wrong padding, the wrong alphabet (standard vs Base64URL), or bytes that are not valid UTF-8. The page does not crash and does not invent decoded text.
- Can I decode JWT tokens here?
- You can decode a single Base64URL segment. A compact JWT has three segments and extra structure. Use the JWT Decoder if you need header, payload, and claims side by side.
- Can I convert an image to Base64 here?
- This page is for UTF-8 text. Use the Image to Base64 Converter to encode PNG, JPEG, GIF, WebP, BMP, or SVG, or to preview a data URI.
- Is Base64 encryption?
- No. Base64 is an encoding, not encryption. Anyone can decode it. Do not treat encoded text as secret just because it looks unreadable.
Related tools
Continue with related browser-based tools on Toolshelf.
- Image to Base64 Converter — Image to Base64 converter.
- URL Encoder & Decoder — Online URL encoder and decoder.
- JWT Decoder & Inspector — Online JWT decoder and inspector.
- JSON Formatter & Minifier — JSON formatter online: beautify, minify, and validate JSON in your browser.
- Code Formatter & Beautifier — Online code formatter and beautifier.
- Regex Tester — Online Regex Tester and Debugger.
- Hash Generator — Online hash generator.
- Unix Timestamp Converter — Epoch converter: Unix timestamp to date (and back).
Ready to encode or decode Base64?
Scroll up, paste text or Base64, and copy the result. Processing stays in this browser tab.
Back to encoderUse cases
- For Developers — Format JSON, test regex, decode JWTs, and work with timestamps.
What would you like to do next?
Continue working with the next step in this workflow. Recently used tools in this set are listed first.
- Image to Base64 Converter — Image to Base64 converter.
- URL Encoder & Decoder — Online URL encoder and decoder.
- JWT Decoder & Inspector — Online JWT decoder and inspector.
- JSON Formatter & Minifier — JSON formatter online: beautify, minify, and validate JSON in your browser.
You may also need
Continue with related browser-based tools on Toolshelf.
- Image to Base64 Converter — Image to Base64 converter.
- URL Encoder & Decoder — Online URL encoder and decoder.
- JWT Decoder & Inspector — Online JWT decoder and inspector.
- JSON Formatter & Minifier — JSON formatter online: beautify, minify, and validate JSON in your browser.
- Code Formatter & Beautifier — Online code formatter and beautifier.
- Regex Tester — Online Regex Tester and Debugger.
- Hash Generator — Online hash generator.
- Unix Timestamp Converter — Epoch converter: Unix timestamp to date (and back).