URL Encoder and Decoder

Percent-encode text so it is safe to put in a URL, or decode an encoded URL back to readable text. This URL encoder and decoder supports full UTF-8.

Updated
Runs in your browser. Your data is not uploaded.
Direction

How to use the URL Encoder and Decoder

  1. Paste your text or URL into the input box.
  2. Choose Encode or Decode, pick Component or Full URL mode, and tick Spaces as + for form-style encoding.
  3. The result updates as you type. Press Copy, or Swap to move the result into the input and flip the direction.

How it works

Text is converted to UTF-8 bytes. Each byte that isn't allowed is written as % followed by two hex digits.

  • Component mode encodes everything except the unreserved characters A-Z a-z 0-9 - _ . ~. It works like encodeURIComponent and is the right choice for a single query value.
  • Full URL mode also keeps : / ? # [ ] @ ! $ & ' ( ) * + , ; =, so the structure of the address survives. It works like encodeURI.
  • Spaces as +: when encoding, spaces become +. When decoding, + is turned into a space before the rest is decoded.

Examples

  • Component encode hello world & more = hello%20world%20%26%20more.
  • Decode caf%C3%A9 = café.
  • Full URL encode https://example.com/search?q=café & tea = https://example.com/search?q=caf%C3%A9%20&%20tea. The & is kept, which is why query values should be encoded in Component mode.

Characters that need encoding

CharacterEncodedWhy
Space%20Not allowed in URLs
&%26Separates query parameters
=%3DSeparates a name from its value
?%3FStarts the query string
#%23Starts the fragment
/%2FSeparates path segments
+%2BMeans a space in form data
%%25Starts an encoded character

Letters, digits, and - _ . ~ never need encoding.

Limitations

  • A broken % sequence, such as %E0%A4%A, gives an error that points to its position.
  • Decoding text that has no % in it returns the text unchanged, with a note.
  • Full URL mode can't tell which & or = belong to a value. Encode each value in Component mode before building the URL.

Frequently asked questions

What is URL encoding?

It replaces characters that aren't allowed in URLs with % followed by two hex digits. For example, a space becomes %20.

When should I use Component vs Full URL mode?

Use Component for a single value, such as a search term in a query string. Use Full URL when you have a complete address and want to keep its structure.

Why do some URLs use + instead of %20?

HTML forms encode spaces as + in query strings. Both mean a space in that context.

Does it support non-English characters?

Yes. Text is encoded as UTF-8, so any language and emoji work.

Often used together with the URL Encoder / Decoder.