Home / URL Encoder/Decoder

URL Encoder & Decoder

URL encoding converts characters into a format safe for transmission in URLs. Special characters like spaces, ampersands, and question marks are converted to percent-encoded values. This tool supports both encodeURIComponent and encodeURI methods.

encodeURIComponent

Encodes special characters including: ; , / ? : @ & = + $ #

Best for query parameters and path segments.

encodeURI

Preserves URL structure characters: ; , / ? : @ & = + $ #

Best for encoding complete URLs.

How to Encode/Decode URLs

  1. 1

    Select Mode & Type

    Choose Encode or Decode mode, then select encodeURIComponent (for query params) or encodeURI (for full URLs).

  2. 2

    Enter Your Text

    Paste your text or URL into the input field. For encoding, enter plain text. For decoding, enter the percent-encoded string.

  3. 3

    Get Your Result

    Click the action button and copy your encoded/decoded result from the output field.

Frequently Asked Questions

What is URL encoding?

URL encoding (also called percent-encoding) converts characters into a format that can be transmitted over the Internet. Special characters are replaced with a '%' followed by their hexadecimal value. For example, a space becomes '%20'.

What's the difference between encodeURI and encodeURIComponent?

encodeURI is used for encoding complete URLs and preserves URL-special characters like /, ?, &, =. encodeURIComponent encodes everything except letters, digits, and a few special characters, making it ideal for encoding query parameter values.

When should I URL encode?

You should URL encode when: passing data in URL query strings, including special characters in URLs, sending form data, or working with any text that will be part of a URL. This ensures the URL is valid and properly interpreted.

Why do I see %20 instead of spaces in URLs?

Spaces are not allowed in URLs according to RFC 3986. When a space needs to be included in a URL, it must be encoded as %20 (the hexadecimal representation of the space character). Some systems also use + for spaces in query strings.