All generators

Web

URL Encoder / Decoder

Encode a URL or text string using percent-encoding, or decode a percent-encoded string back to plain text. Choose between encoding the full URL or encoding a query parameter value.

URL input

Generated output

Enter a URL or text string to encode or decode.

How it works

URL encoding (percent-encoding) replaces characters that are not allowed in URLs with a % sign followed by their two-digit hexadecimal ASCII code. For example, a space becomes %20 and a hash becomes %23.

Component encoding (encodeURIComponent) encodes everything except unreserved characters (A–Z, a–z, 0–9, -, _, ., ~). Full URL encoding (encodeURI) preserves structural URL characters like /, ?, =, and & so the URL structure remains intact. Use component encoding for query parameter values; use full URL encoding for complete URLs.

Practical example

The query parameter value "hello world & more" component-encoded becomes: hello%20world%20%26%20more.

The full URL "https://example.com/search?q=hello world" encoded with encodeURI becomes: https://example.com/search?q=hello%20world — only the space is encoded, not the structural characters.

Frequently asked questions

Answers to common questions about this generator and how it works.

When should I use component encoding vs full URL encoding?

Use component encoding (encodeURIComponent) when encoding a single query parameter value that may contain &, =, or other URL-structural characters. Use full URL encoding (encodeURI) when encoding a complete URL where you want to preserve its structure.

Why does %20 appear instead of +?

Both %20 and + represent a space in URLs, but in different contexts. %20 is the correct percent-encoding. The + convention for spaces is specific to HTML form submissions (application/x-www-form-urlencoded) and is not universally valid.

What characters are safe in URLs without encoding?

Unreserved characters — A–Z, a–z, 0–9, hyphen (-), underscore (_), period (.), and tilde (~) — are safe in any URL context. All other characters should be percent-encoded.

Why do some URLs have %2F or %3A in them?

%2F is an encoded forward slash and %3A is an encoded colon. They appear when a parameter value itself contains characters that would otherwise be interpreted as URL structure. For example, a URL parameter containing another URL needs its slashes and colons encoded.

Is this the same as HTML entity encoding?

No. HTML entity encoding (e.g. & for &) is for HTML context. URL encoding is for URL context. They are separate encoding schemes and should not be confused or mixed.

Related generators

Explore other generators that pair well with this one.

Base64 Encoder / Decoder

Encode text to Base64 or decode Base64 back to plain text.

Slug Generator

Convert titles and phrases into clean, SEO-friendly URL slugs.

Hash Generator

Generate SHA-256, SHA-1, or MD5 hashes from any text.