Base64 / URL Encoder-Decoder
Encode or decode text as Base64 or a URL component, instantly.
What is it?
This tool encodes and decodes text using either Base64 or URL percent-encoding, showing both results at once so you can convert in either direction from a single input.
Formula Explanation
Base64 encoding converts binary data into a 64-character alphabet (A-Z, a-z, 0-9, +, /), commonly used to safely embed data in text-based formats like JSON or HTML. URL encoding (percent-encoding) instead replaces unsafe or reserved characters — spaces, symbols, non-ASCII characters — with a %XX escape sequence so text can be safely used inside a URL.
Example Calculation
The text Hello, World! encodes to SGVsbG8sIFdvcmxkIQ== in Base64, and to Hello%2C%20World! in URL encoding.
How to Use
- Choose Base64 or URL mode using the tabs.
- Type or paste your text into the Input box.
- The Encoded box shows your input converted to that format.
- The Decoded box shows what your input would be if it were already encoded text.
Benefits
- Shows encoding and decoding side by side, so you don't need to switch tools depending on direction.
- Supports both Base64 (for data embedding) and URL encoding (for safe URLs) in one place.
- Runs entirely in your browser, so sensitive text never leaves your device.
Use Cases
- Encoding a string to safely include in a data URL or API payload.
- Decoding a Base64 token or JWT segment to inspect its contents.
- Encoding a query parameter value that contains spaces or special characters for a URL.
What Your Result Means
If the Decoded box shows an error, your input likely isn't valid encoded text in that mode — Base64 decoding fails on invalid characters or padding, and URL decoding fails on malformed percent-escape sequences.
Tips
- Base64-encoded text is about 33% longer than the original — expect that size increase when embedding it elsewhere.
- Use URL encoding only for the parts of a URL that need it (like a query value), not the entire URL, or you'll break the structure.
- Base64 is not encryption — anyone can decode it back to the original text.
Common Mistakes
- Assuming Base64 encoding is a form of security or encryption — it's fully and easily reversible.
- URL-encoding an entire URL including the scheme and slashes, which breaks it instead of making it safe.
- Trying to Base64-decode text that isn't actually Base64, which produces garbled or invalid output.
FAQs
Does this tool send my text to a server?
No, all encoding and decoding happens locally in your browser using built-in JavaScript functions.
Is Base64 encoding secure?
No, Base64 is just a reversible encoding scheme, not encryption — anyone with the encoded text can decode it back to the original.
Why does my Base64 output end with an = sign?
The = characters are padding, added when the input length isn't a multiple of 3 bytes, so the encoded output aligns to the required 4-character blocks.
What's the difference between encodeURIComponent and Base64?
URL encoding escapes only the specific characters unsafe in a URL, while Base64 re-encodes the entire input into a different character set, regardless of what it will be used for.
Encoding and decoding happen locally in your browser and your text is never sent to a server.
Last updated: July 27, 2026