Base64 Encode/Decode
Unicode-safe Base64 encode/decode for text and files locally.
Base64 Encode/Decode converts text and local files to Base64 and back using Unicode-safe browser APIs. Paste a string, pick a file, or load an example—everything stays on your device with no upload step.
How it works
In text mode, the tool uses TextEncoder to turn your string into UTF-8 bytes, then btoa with chunked conversion for large inputs. Decoding reverses the flow with atob and TextDecoder. File mode reads bytes from a selected file via the File API and encodes them locally.
Benefits
- Unicode-safe encode and decode for international text and emoji
- Text and local file input without server upload
- Chunked conversion handles larger strings reliably
- Copy, download, examples, and optional on-device history
Use cases
- Encode small JSON or config snippets for data URLs
- Inspect Base64 fragments from logs or API responses
- Convert a local file to a Base64 string for testing
- Verify UTF-8 round-trip behavior before integration work
Best practices
- Use text mode for strings and file mode for binary payloads
- Confirm whether your API expects standard Base64 or Base64url
- Do not treat Base64 as encryption for secrets or credentials
- Clear the workspace on shared machines after handling sensitive data
Common mistakes
- Expecting readable text after decoding binary Base64
- Mixing Base64url (- and _) with standard Base64 (+ and /)
- Forgetting padding characters when manually editing Base64
- Assuming Base64 hides sensitive tokens from others
Privacy
All encoding and decoding happens in your browser. Files are read from your device only and are never uploaded. Optional LocalStorage history stores inputs locally if you enable it—avoid saving secrets on shared profiles.
Frequently asked questions
- Does Base64 Encode/Decode upload my files or text?
- No. Encoding and decoding run entirely in your browser using native APIs. Files are read locally and never sent to a server.
- How does this tool handle Unicode and emoji?
- Text is converted with TextEncoder and TextDecoder before Base64 conversion, so UTF-8 characters like café, 你好, and emoji encode and decode correctly.
- What is the difference between text and file mode?
- Text mode encodes or decodes strings you paste. File mode reads a local file as raw bytes and outputs Base64 without uploading the file.
- Why does my decoded output look like gibberish?
- Base64 often represents binary data, not readable text. If you encoded an image or compressed file, the decoded bytes are not meant to display as plain text.
- Can I decode Base64 back to a downloadable file?
- This tool focuses on text and inspection. Copy the decoded output or use Download for the Base64 string. For large binary round-trips, use a dedicated file converter.
- Does Base64 encryption protect my data?
- No. Base64 is an encoding scheme, not encryption. Anyone can decode it. Never treat Base64 as a security control.
- What characters are valid in Base64?
- Standard Base64 uses A–Z, a–z, 0–9, plus, slash, and optional padding equals signs. Whitespace in pasted input is ignored during decode.
Related tools
URL Encode/Decode
developer
URL percent-encoding with component and URI modes locally.
- url
- encode
- decode
- percent-encoding
Hash Generator
crypto
SHA-256/512 hashing for text and files via Web Crypto.
- hash
- sha256
- sha512
- checksum
Cron Explainer
developer
Turn cron expressions into readable schedules.
- cron
- scheduler
- developer
- devops
Query String Parser
developer
Parse and build URL query strings safely, client-side.
- url
- query-string
- parser
- developer
Regex Tester
developer
Test regex patterns with flags, highlights, and safe timeout protection.
- regex
- developer
- pattern
- replace
Caesar Cipher
security
Adjustable-shift Caesar cipher, encode and decode.
- caesar
- cipher
- encode
- decode