URL Encoder / Decoder Online

Encode or decode URLs and query strings instantly. Free, private, no signup.

Plain Text / URL
0 chars
Encoded Output
0 chars

Quick Examples

URL Encoding Guide

encodeURIComponent()

Encodes everything except: A-Z a-z 0-9 - _ . ! ~ * ' ( )

Use for: query parameter values, path segments, individual URL components.

Input: hello world
Output: hello%20world

encodeURI()

Encodes everything except URL structure characters: ; , / ? : @ & = + $ #

Use for: encoding a complete URL while preserving its structure.

Input: https://x.com/q?a=b c
Output: https://x.com/q?a=b%20c

Common Percent-Encoded Characters

Character Encoded Common Use
Space%20Queries, paths
+%2BMath operators in params
/%2FPath separator in params
?%3FQuery marker in params
&%26Param separator in values
=%3DKey=value in params
#%23Fragment identifier
@%40Email in URLs
encodeURIComponent vs encodeURI — when to use which?
Use encodeURIComponent when encoding a value that will be embedded inside a URL (like a query parameter value or path segment). It encodes &, =, ?, / and other URL structure characters.

Use encodeURI when you have a complete URL that you want to sanitize while keeping its structure intact. It leaves URL delimiters (://, ?, &, =) unencoded.

When in doubt: use encodeURIComponent — it's safer for embedding values.
Why does + sometimes mean space in URLs?
Two different encoding schemes exist:

Percent-encoding (RFC 3986): Space → %20. Used in URLs generally.

application/x-www-form-urlencoded: Space → +. Used in HTML form submissions and some query strings.

When your server receives a query string, it should decode + as space in form data contexts but not in path segments. This is why you sometimes see ?q=hello+world (form) vs ?q=hello%20world (RFC 3986).