URL Encoder / Decoder

Encode special characters in URLs using percent-encoding, or decode percent-encoded URLs back to plain text. Supports full encodeURIComponent and partial encodeURI modes.

Input

Output

✓ Copied!
Encoded URL will appear here…

FAQ

What is the difference between encodeURI and encodeURIComponent?

encodeURI encodes a full URL and leaves characters like : / ? & = intact. encodeURIComponent encodes every special character, making it suitable for encoding query parameter values.

When should I use URL encoding?

Use URL encoding whenever you include special characters (spaces, accents, symbols) in a URL — especially in query string values.

Does this tool send my data to a server?

No. All encoding and decoding happens entirely in your browser using the built-in encodeURIComponent / decodeURIComponent functions.

Frequently Asked Questions

What is URL encoding?

URL encoding (percent encoding) replaces unsafe ASCII characters with a % followed by their hexadecimal code, making them safe to transmit in a URL.

What is the difference between encodeURI and encodeURIComponent?

encodeURI encodes a full URL, preserving characters like /, ?, #, :. encodeURIComponent encodes a single component (e.g., a query parameter value), encoding those structural characters too.

Does this tool double-encode?

No. The tool detects if a string is already encoded before encoding to prevent double-encoding errors.

What is URL Encoding?

URL encoding (also called percent-encoding, defined in RFC 3986) is a way to represent special characters in a URL using only ASCII characters. Each unsafe or reserved character is replaced by a percent sign followed by its two-digit hexadecimal UTF-8 byte value.

For example, a space is encoded as%20(or + in query strings), and an at-sign@becomes %40. Without encoding, these characters would be misinterpreted as URL structural elements.

Common Percent-Encoded Characters

CharacterEncodedReason
(space)%20Breaks URL parsing
&%26Query string delimiter
=%3DKey=value separator
+%2BDecoded as space in query strings
/%2FPath segment separator
?%3FQuery string start
#%23Fragment identifier
%%25Escape character itself
@%40User info delimiter
é, ñ, ü%C3%A9, %C3%B1, %C3%BCNon-ASCII UTF-8 characters

encodeURI vs encodeURIComponent

JavaScript provides two functions; choosing the wrong one is a common bug:

  • encodeURI(url)

    Encodes a complete URL. Preserves structural characters like / ? # : @. Use when you have a full URL and want to make it safe to embed.

  • encodeURIComponent(value)

    Encodes a single query parameter value. Also encodes / ? # : @. Use for individual values inside a query string.