URL Encoder/Decoder

Encode or decode URLs and query strings. Convert special characters to percent-encoded format for safe use in URLs.

Common URL Encodings

%20 or +

!

%21

#

%23

$

%24

&

%26

'

%27

(

%28

)

%29

*

%2A

+

%2B

,

%2C

/

%2F

:

%3A

;

%3B

=

%3D

?

%3F

@

%40

[

%5B

]

%5D

Encoding Methods Explained

Component

encodeURIComponent() - Encodes everything except alphanumeric and - _ . ! ~ * ' ( ). Best for query parameters.

Full URI

encodeURI() - Preserves URL structure characters. Use for complete URLs with path and query.

Form Data

application/x-www-form-urlencoded - Same as Component but spaces become + instead of %20.

What is URL Encoding?

URL encoding, also known as percent-encoding, is a mechanism for encoding information in a Uniform Resource Identifier (URI). It replaces unsafe ASCII characters with a "%" followed by two hexadecimal digits representing the character's ASCII code.

Why Encode URLs?

  • Safety: Reserved characters like &, ?, = have special meaning in URLs
  • Special Characters: Non-ASCII characters must be encoded for compatibility
  • Spaces: URLs cannot contain spaces—they must be encoded as %20 or +
  • API Calls: Query parameters often contain characters that need encoding

Encoding Methods

  • encodeURIComponent: Encodes everything except A-Z, a-z, 0-9, - _ . ! ~ * ' ( )
  • encodeURI: Preserves URL structure characters like : / ? # [ ] @
  • Space as +: Form data encoding where spaces become + instead of %20

Common Use Cases

  • Building API request URLs with query parameters
  • Encoding form data for submission
  • Creating bookmarklets and javascript: URLs
  • Debugging URL-related issues

Related Tools