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

EncodingUse it for
Base64Putting binary data or any text into email, JSON, data URLs or HTTP headers
Base64URLTokens 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 entitiesShowing < > & and quotes as text in a web page
Hex / binarySeeing the actual bytes of a text
Unicode escapesNon-ASCII text in JavaScript, JSON or Java source
ROT13Hiding 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 (A and 1 stay untouched as unreserved characters, & becomes %26, = becomes %3D, and ₹ becomes its three UTF-8 hex bytes %E2%82%B9).
  • HTML Entities: A&amp;B=&#8377;1 (escapes & to &amp; so HTML parsers do not treat &B as an entity, and represents ₹ by its Unicode code point U+20B9 = 8377 decimal).
  • 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&B turns & into &amp; and then &amp;amp;, which displays literal & text on your web page instead of &.
  • Full-URL vs query-component URL encoding: This tool uses encodeURIComponent rules (encoding :, /, ?, &, =), which is meant for query parameter *values*. If you encode an entire https://... URL, https:// becomes https%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.

Last reviewed .

Related converters and guides