Encoder and decoder
Convert text to and from the encodings developers meet every day.
This free online encoder and decoder works in your browser. Everything runs in your browser. What you type is not sent anywhere. All inputs and calculations run locally on your device without server uploads; details on browser processing and storage are set out in the privacy policy.
Which encoding to use
| Encoding | Use it for |
|---|---|
| Base64 | Putting binary data or any text into email, JSON, data URLs or HTTP headers |
| Base64URL | Tokens and IDs in URLs; used inside JWTs |
| URL encode (component) | A single query value: spaces become %20, & becomes %26 |
| URL encode (whole URL) | A full address, keeping : / ? and & as they are |
| HTML entities | Showing < > & and quotes as text in a web page |
| Hex / binary | Seeing the actual bytes of a text |
| Unicode escapes | Non-ASCII text in JavaScript, JSON or Java source |
| ROT13 | Hiding spoilers. It is not encryption |
Encoding is not encryption
Anyone can decode Base64, URL encoding or ROT13 without a key. Never use them to protect passwords or secrets. For that you need real encryption or, for passwords, a hash such as bcrypt.
Unicode handled properly
Text is converted to UTF-8 bytes before encoding, so accents, Hindi, Chinese and emoji survive a round trip. Many quick Base64 snippets break on these.
Worked example: Comparing Base64, URL, HTML Entity, and Hex encoding on the same string
Take the 7-character string A&B=₹1 (8 bytes in UTF-8 because ₹ is the 3-byte sequence E2 82 B9) and compare what each encoding produces:
- Base64 (6-bit binary-to-text):
QSZCPeKCuTE=(encodes the raw 8-byte UTF-8 array into 12 ASCII characters). - URL Percent-Encoding (
encodeURIComponent):A%26B%3D%E2%82%B91(Aand1stay untouched as unreserved characters,&becomes%26,=becomes%3D, and₹becomes its three UTF-8 hex bytes%E2%82%B9). - HTML Entities:
A&B=₹1(escapes&to&so HTML parsers do not treat&Bas an entity, and represents₹by its Unicode code pointU+20B9 = 8377decimal). - Hexadecimal (base 16 byte dump):
41 26 42 3d e2 82 b9 31.
Limits and what this tool cannot do
- Encoding is not encryption or hashing: Every encoding on this page is 100% reversible without a key. To create a one-way cryptographic digest, use the Hash Generator.
- Double-encoding pitfalls: Clicking Encode twice on
A&Bturns&into&and then&amp;, which displays literal&text on your web page instead of&. - Full-URL vs query-component URL encoding: This tool uses
encodeURIComponentrules (encoding:,/,?,&,=), which is meant for query parameter *values*. If you encode an entirehttps://...URL,https://becomeshttps%3A%2F%2F.
Questions
Why does decoding fail?
The input is not valid for that encoding, for example Base64 with characters outside A–Z, a–z, 0–9, + and /. Check you picked the right encoding.
What is the difference between Base64 and Base64URL?
Base64URL uses - and _ instead of + and /, and leaves out = padding, so it is safe in URLs and file names.
Is my data uploaded?
No. Everything runs in your browser. What you type is not sent anywhere.
Why did my URL query parameter break when it contained a + or & sign?
In a URL query string (?q=C++&lang=en), & starts a new parameter and + is decoded by many servers as a space. Percent-encoding turns + into %2B and & into %26 so the server receives the exact characters.
What is the difference between UTF-8 byte values (Hex/URL) and Unicode code points (HTML numeric entities)?
HTML numeric entities (₹ or ₹) use the character's abstract Unicode code point (U+20B9), whereas URL percent-encoding (%E2%82%B9) and Hex encoding output the 3-byte UTF-8 representation of that code point.
Can I use the 'Use result as input' button to test round-trip decoding?
Yes. Click Encode, then click 'Use result as input' followed by Decode to verify that the decoded string matches your original input byte for byte.
Related converters and guides
- Base64 encode and decodeTurn text into Base64 and back, with full Unicode support.
- JWT decoderRead the header and claims of a JSON Web Token and check its signature.
- URL parserSplit a URL into parts and edit its query string.
- HTML to stringTurn HTML into a JavaScript, Java, PHP, Python or C# string.