What the Base64 Encoder & Decoder does
Base64 is a way of writing any data using only 64 safe characters: A–Z, a–z, 0–9, plus “+” and “/”. It is used wherever binary data or special characters have to travel through systems that only handle plain text, such as email attachments, JSON APIs, data URLs in HTML and CSS, basic HTTP authentication and JSON Web Tokens.
This tool encodes text to Base64 and decodes Base64 back to readable text as you type. It fully supports UTF-8, so umlauts, accents, Persian or Chinese characters and emojis survive the round trip unchanged — a common problem with simpler converters. An optional URL-safe mode replaces “+” and “/” with “-” and “_” and drops the “=” padding, which is the variant used in URLs, file names and JWTs.
Encoding and decoding happen locally in your browser. Nothing you paste is sent to a server, so you can safely decode tokens or configuration values that contain private information.
When to use it
Reading API data
Many APIs return fields such as attachments, signatures or encoded payloads in Base64. Decode them to see what they contain.
Inspecting tokens
The header and payload of a JSON Web Token are URL-safe Base64. Paste a part between the dots to read its JSON.
HTTP Basic authentication
The Authorization header contains “username:password” encoded as Base64. Create or check such a value for testing.
Configuration and secrets
Kubernetes secrets, CI variables and some config files store values as Base64. Decode them to verify they are correct.
Tips for the best results
- Base64 is an encoding, not encryption. Anyone can decode it, so never use it to hide passwords or sensitive data.
- Encoded text is about 33% longer than the original, because every 3 bytes become 4 characters.
- If decoding fails, check for missing characters at the end or line breaks copied from an email; whitespace is ignored automatically.
- Use URL-safe mode whenever the result will appear in a web address, a cookie or a file name.
- Use the swap button to check a result: encode a text, swap, and you should get the original back.
How the Base64 Encoder & Decoder works
For encoding, the text is first converted to UTF-8 bytes. Each group of three bytes (24 bits) is split into four 6-bit numbers, and each number is replaced by one of the 64 characters of the Base64 alphabet. If the last group is incomplete, “=” signs pad the result to a multiple of four characters.
Decoding reverses the process. The tool removes spaces and line breaks, converts URL-safe characters back to the standard alphabet, adds missing padding and then decodes the bytes strictly as UTF-8. If the bytes are not valid text — for example because the Base64 contains an image — you get an error message instead of garbled characters.
This page works with text. Binary files such as images or PDFs are not converted here.