Base64 Encode and Decode
Encode text to Base64, or decode it back.
- 100% Free
- No Sign Up
- Works in Your Browser
Base64 encode/decode
Encode and decode Base64 text
More Developer Tools
View all tools- Image to Base64Turn an image into a data URI
- URL encode/decodePercent-encode and decode URLs
- HTML entity encoderEscape and unescape HTML entities
- JWT decoderDecode a JSON Web Token
- JSON escape/unescapeEscape text for a JSON string
- JSON formatterPretty-print and indent JSON
- UUID generatorGenerate random v4 or time-ordered v7 UUIDs
- Timestamp converterConvert Unix epoch time to dates
- Regex testerTest regular expressions live
Every everyday developer tool, right in your browser.
No installs. No uploads. No signup.
Browse all 36 tools- Developer tools
- 36
- Cheat sheets
- 10
- Bytes uploaded
- 0
How to use the Base64 encode/decode
Three steps, all in your browser.
- 1
Paste your input
Type or paste your code or data. Press Sample to try an example.
- 2
Choose the direction
Encode or decode. Errors point at what's wrong with the input.
- 3
Copy the result
Copy the output in one click. Nothing is saved or sent anywhere.
Base64 Encode and Decode: what to know
This tool encodes text to Base64 and decodes Base64 back to text. Text is converted to UTF-8 bytes first, so accented letters, non-Latin scripts and emoji round-trip correctly, which isn't the case with the browser's plain btoa() function. A URL-safe option uses the base64url alphabet from RFC 4648, with - and _ instead of + and /.
Base64 represents binary data with 64 printable characters, 6 bits per character, so every 3 bytes become 4 characters and the output is about a third larger. Padding with = fills the last group. It exists so binary data can pass through systems that only handle text: email attachments (MIME), data URIs, HTTP Basic authentication headers, JSON fields holding files, and the parts of a JWT.
Base64 is an encoding, not encryption. There is no key: anyone can decode it, instantly. An API key or password in Base64 is as exposed as one in plain text, so never use it to hide secrets.
Popular uses
- Decoding Base64 values in API responses and configs
- Building and checking HTTP Basic auth headers
- Reading Kubernetes Secret values, which are Base64-encoded
- Encoding text for data URIs and email
Tips for the best result
- If decoding fails, check for spaces or line breaks added when copying, and for URL-safe characters (- and _).
- Base64 that decodes to unreadable characters is probably binary data, such as an image or compressed file, not text.
- To turn an image into Base64, use the Image to Base64 tool instead.
Read how JustYourDev works and our privacy details. Code, data and files you use here are processed in your browser and are never sent to our server.