What this Base64 tool does
Base64 represents binary data using 64 printable ASCII characters, so it can travel safely through systems built for text: JSON, email, HTML attributes, HTTP headers and environment variables. This tool encodes text to Base64 and decodes it back with full UTF-8 support, offers the URL-safe variant used in JWTs and web tokens, and can turn any file into a data: URL you can paste into CSS or HTML.
How to use it
- Choose Encode or Decode.
- Enter your text. Emoji and non-Latin scripts are encoded as UTF-8 bytes, so they round-trip correctly.
- Toggle URL-safe to replace
+and/with-and_and drop the=padding. - Use Swap to feed the output back as input in the opposite direction.
- For files, click File → Data URL, choose a file and copy the resulting string.
Practical examples
- HTTP Basic auth: encode
user:passwordto build anAuthorization: Basic dXNlcjpwYXNzd29yZA==header. - Inspecting a JWT: paste the middle segment of a token and decode it to read the JSON payload. The decoder handles missing padding automatically.
- Inline icons: convert a small SVG or PNG to a data URL and use it directly in
background-image: url(...)to save an HTTP request. - Kubernetes secrets: values in a Secret manifest must be Base64-encoded; encode them here without sending them to any server.
Tips and edge cases
- Base64 is an encoding, not encryption. Anyone can decode it, so never treat it as a way to hide secrets.
- Encoded data is about 33% larger than the original: every 3 bytes become 4 characters.
- Data URLs larger than a few kilobytes usually hurt performance because they cannot be cached separately and block CSS parsing.
- If decoding fails, check for line breaks inserted by email clients, or for URL-safe characters in a standard decoder. This tool accepts both alphabets.
- Decoding binary files to text produces unreadable output; that is expected.