Runs in your browser. Nothing you enter is uploaded or stored.
To encode text as Base64 or decode it back, paste it into the free Base64 Encoder and Decoder above and choose Encode or Decode. It handles accented letters and emoji correctly as UTF-8, can produce URL-safe output with a minus sign and an underscore in place of the plus and slash and with the padding left off, and has a line-by-line mode that converts a whole list at once. Invalid input is reported line by line with the reason, and the result can be copied or downloaded.
Last updated: 11 November 2026. Written by Saad Raza.
Key takeaways
- Base64 turns any bytes into a string of 64 safe characters (A to Z, a to z, 0 to 9, plus and slash) so that data can travel through systems that only handle text: email, JSON, URLs, HTML and configuration files.
- It is an encoding, not encryption. Anyone can decode it in a second, so never use it to hide a password or a secret.
- Base64 makes data about a third larger: every 3 bytes become 4 characters. That is why embedding large images as Base64 makes pages heavier.
- Text must be converted to bytes first. This tool uses UTF-8, so non-English letters and emoji survive a round trip, which many simple converters get wrong.
- Everything runs in your browser. Strings with tokens or personal data are not uploaded.
What Base64 is for
Computers move bytes, but many channels are built for text. An email body, a JSON field or a query string can break on certain byte values: a null byte, a newline, a quote. Base64 solves that by representing the bytes using only 64 characters that are safe almost everywhere. Three bytes become four characters, with an equals sign or two added at the end as padding when the length is not a multiple of three.
You meet Base64 more often than you might think. Data URIs embed small images directly in HTML or CSS. Email attachments are Base64 in the message. HTTP Basic authentication sends a username and password as Base64, which is why it must always run over HTTPS. JSON Web Tokens are Base64-URL segments. Some APIs return files or signatures as Base64 strings, and tools like Google Search Console, tag managers and consent systems sometimes pass configuration in this form. Being able to decode one by hand is a useful skill when you debug.
How to use the Base64 Encoder and Decoder
- Paste text to encode, or a Base64 string to decode.
- Choose Encode or Decode.
- Tick Treat each line separately to convert a list, one item per line. Leave it off to convert the whole box as a single string, including line breaks.
- For encoding, tick URL-safe output to use – and _ instead of + and /, and Leave off the = padding if the destination does not want it.
- Press Convert. Copy or download the result. Lines that are not valid Base64 are listed with the problem.
Standard and URL-safe Base64
| Variant | Characters 62 and 63 | Padding | Used in |
|---|---|---|---|
| Standard | + and / | Yes (=) | Email, data URIs, most APIs |
| URL-safe | – and _ | Often omitted | JSON Web Tokens, query strings, file names |
The plus and slash of the standard form have meanings in URLs, so URL-safe Base64 replaces them. The decoder accepts either form, so you can paste a string without knowing which it is.
A worked example
The example encodes three lines in line-by-line mode: “Saad Raza SEO”, “Café crème — 100% free” and “https://saadrazaseo.com/seo-tools/”. The first becomes U2FhZCBSYXphIFNFTw==. The second contains an accented letter and a dash that is more than one byte in UTF-8, and becomes Q2Fmw6kgY3LDqG1lIOKAlCAxMDAlIGZyZWU=. The third becomes aHR0cHM6Ly9zYWFkcmF6YXNlby5jb20vc2VvLXRvb2xzLw==.
The decode example does the reverse on three lines, and the third, “not base64!”, is rejected because it contains characters outside the Base64 alphabet. The tool reports that line as an error and still decodes the other two. You also see why UTF-8 matters: a converter that treated the dash as a single byte would corrupt the result, so the text would not decode back to what you started with.
Practical uses
- Inspecting tokens and parameters. If a link or an API response carries a Base64 string, decode it to see what it holds. Often it is readable JSON, which you can format and check with the JSON formatter and validator.
- Data URIs. Small icons can be inlined as Base64 to save a request. Do this only for very small files: the 33 percent size increase and the loss of caching mean large images are better served as files. See the image compressor for shrinking images properly.
- Passing data in URLs. URL-safe Base64 lets you carry a block of data in one parameter. If you also need to encode normal text for a query string, use the URL encoder and decoder.
- Debugging email. Message bodies and headers are often Base64 or a close relative. Decoding a header shows the real subject or sender name, which is useful when you investigate delivery problems alongside the email spam word checker.
- Checking verification strings. Some DNS and site-verification records contain Base64 values. Inspect DNS records with the DNS lookup tool.
Security: Base64 is not protection
It is common to see credentials or personal data “hidden” in Base64 in a page’s source, a configuration file or a URL. This offers no protection at all. Anyone can decode it with a tool like this one in seconds. If you find a secret encoded this way in a public place, treat it as exposed, change it and move it out of the page. Basic authentication has the same weakness: the header is only Base64, so the connection must be encrypted. Check that your site’s certificate is valid with the SSL checker.
The same caution applies to search. Content stored only as Base64 in a page’s source, for example a block of text that a script decodes and writes into the page, is hard for crawlers to treat as ordinary content, and may not be indexed reliably. Keep important text as plain HTML. If you want a review of how search engines and AI systems actually see your pages, my SEO audit covers rendering and indexing.
Limits
The tool converts text. It does not encode files or images, and a decoded string that is not valid UTF-8 text is shown with a note that it may be binary data, such as an image. Base64 strings with line breaks or spaces are accepted by removing the whitespace before decoding. In bulk mode each line is converted separately, up to 5,000 lines, so line breaks inside a single item are not preserved. Processing happens in your browser, and nothing is sent to a server.
Questions about the Base64 Encoder and Decoder
What is Base64 used for?
Carrying binary or special-character data through text-only channels, such as email, JSON, HTML data URIs and URLs.
Is Base64 encryption?
No. It is a reversible encoding with no key, so anyone can decode it. Do not use it to protect secrets.
Why does Base64 end with equals signs?
They are padding. Base64 works in groups of three bytes, and when the data does not fill the last group, one or two equals signs make up the length.
What is URL-safe Base64?
A variant that uses a minus sign and an underscore instead of plus and slash, and often omits the padding, so the string can sit in a URL or file name without further encoding.
Is my text uploaded?
No. Encoding and decoding happen in your browser, so tokens and private strings stay on your device.
If you want help with the technical side of your site, see my SEO services or ask for a free audit. You can also browse the other free technical SEO tools.
Request received
Thank you! Saad will contact you within the next 24 hours.
Keep an eye on your phone and inbox.
