🔗

URL Encoder & Decoder

Encode and decode URL components

Tip: Use encodeURIComponent for query parameter values. Use encodeURI only for full URLs where you want to preserve : / ? & characters.
Common URL Encodings Reference
%20
!%21
"%22
#%23
$%24
&%26
'%27
+%2B
,%2C
/%2F
:%3A
?%3F
@%40
=%3D

When to Use URL Encoding

Query Parameters

When passing user input as query parameters: `` https://example.com/search?q=hello%20world `

Form Submissions

HTML forms with
application/x-www-form-urlencoded encoding use URL encoding.

Path Segments

File names or resource identifiers with special characters need encoding.

URL Encoding Table

| Character | Encoded | Space%20 !%21 "%22 #%23 $%24 &%26 | + | %2B |

JavaScript Methods

  • encodeURI() - Encode full URLs
  • encodeURIComponent() - Encode URL components
  • decodeURI() - Decode full URLs
  • decodeURIComponent()` - Decode URL components

Frequently Asked Questions

What is URL encoding?

URL encoding (percent-encoding) replaces unsafe ASCII characters with a % followed by two hexadecimal digits. For example, a space becomes %20. This ensures special characters don't break URL parsing.

Which characters need URL encoding?

Characters that need encoding include: spaces, quotes, angle brackets, curly braces, pipes, backslashes, and any non-ASCII characters. Reserved characters like &, =, and ? also need encoding when used as data rather than delimiters.

What's the difference between encodeURI and encodeURIComponent?

encodeURI encodes a full URI, preserving characters like : / ? & that have special meaning in URLs. encodeURIComponent encodes everything, including those special characters. Use encodeURIComponent for query parameter values.

Related Tools

Explore other tools you might find useful:

Specialized Versions

Try our targeted calculators for specific use cases: