Base64 Tool
This free tool encodes or decodes text as Base64, and separately encodes or decodes URL components, both common developer tasks for working with text that needs to travel safely through a URL, a file, or an API. Nothing you enter is sent anywhere or stored.
How to Use It
- Paste or type text into either panel's Text field.
- Choose Encode or Decode.
- The result updates instantly. Use the Copy button to copy it to your clipboard.
How It Works
Base64 encoding takes the raw bytes behind any text (using UTF-8, the standard way text is represented as bytes) and re-expresses every group of 3 bytes as 4 plain-text characters, drawn from a fixed set of 64 safe characters, letters, numbers, plus, and slash, with an equals sign added at the end when the input length does not divide evenly by 3. Decoding simply reverses that process. Encoding "hello world" produces "aGVsbG8gd29ybGQ=", and decoding that string returns exactly "hello world".
URL encoding works differently: it looks for any character that is not safe to use directly inside a URL (a space, an ampersand, an equals sign, and others) and replaces each one with a percent sign followed by its two-digit hexadecimal code. Encoding "a & b = c?" produces "a%20%26%20b%20%3D%20c%3F", and decoding that string returns the original text.
Everything runs client-side in your browser, using the same built-in functions any website's own code would use. Nothing you enter is sent anywhere or stored.
Frequently Asked Questions
What is Base64 encoding actually for?
Base64 turns arbitrary data into plain text made up only of letters, numbers, plus, slash, and an equals sign for padding, characters that are safe to put almost anywhere: inside JSON, an email, a URL, or a text file, without anything getting corrupted or misread as a special character. It is a common misconception that Base64 is a form of encryption or compression. It is neither. It is purely a representation format, and anyone can decode it back to the original text in seconds, exactly what this tool does.
Why does URL encoding use encodeURIComponent instead of encodeURI?
They solve different problems. encodeURI assumes you are giving it an already-complete URL and leaves characters like / and : alone, since those are meaningful parts of a URL structure. encodeURIComponent assumes you are giving it a single value, like a query parameter or a path segment, that is going inside a URL, so it encodes everything that could otherwise be misread as part of the URL structure itself, including / and :. This tool uses encodeURIComponent, since encoding a single value is by far the more common need.
Why did decoding fail with an error?
For Base64, the text you pasted either contains characters outside the valid Base64 alphabet, has incorrect padding, or decodes to a byte sequence that is not valid UTF-8 text. For URL decoding, the text contains a percent sign not followed by two valid hexadecimal digits, or a percent-escape sequence that does not form valid UTF-8 once decoded. Either way, the error means the input was not actually produced by encoding text the same way this tool decodes it.
Does this tool handle files, not just text?
No, this tool works on pasted text only. Base64 is often used to represent file data (an image embedded in HTML or CSS, for example), but encoding a file would need to read its raw bytes first, which this text-focused tool does not do.
Is my text sent anywhere when I use this tool?
No. Every conversion happens in your browser using built-in JavaScript functions. Nothing you type or paste is transmitted or stored anywhere.