DevBolt

URL Encoder Online

Encode text for safe use in URLs. Converts spaces, symbols, and special characters to percent-encoded format (e.g., space → %20, & → %26).

← Back to tools

URL Encoder & Decoder

Encode and decode URL components or full URIs. Fast, private, and free.

Mode:
Encodes all special characters (for query params, path segments)

Quick Reference

Component mode uses encodeURIComponent / decodeURIComponent — encodes everything except A-Z a-z 0-9 - _ . ~ ! * ' ( ). Best for query parameter values and path segments.

Full URI mode uses encodeURI / decodeURI — preserves URL structure characters like : / ? # [ ] @ ! $ & ' ( ) * + , ; =. Best for encoding an entire URL while keeping its structure intact.

What is URL encoding?

URL encoding (percent-encoding) replaces unsafe ASCII characters with a % followed by two hex digits. For example, space becomes %20, & becomes %26, and = becomes %3D. This is required because URLs can only contain a limited set of characters (RFC 3986). Characters like &, =, ?, and # have special meaning in URLs and must be encoded when used as data.

encodeURIComponent vs encodeURI

JavaScript provides two functions: encodeURIComponent() encodes everything except A-Z, a-z, 0-9, -, _, ., ~. Use it for query parameter values. encodeURI() preserves URL-structural characters (:, /, ?, #, &, =). Use it for complete URLs where you want to keep the structure intact.

Frequently Asked Questions

When should I URL-encode?

Always encode user input placed in URLs: query parameters, path segments, and fragment identifiers. This prevents injection attacks and ensures special characters are transmitted correctly.

Is %20 the same as +?

In query strings, + traditionally represents a space (application/x-www-form-urlencoded). In path segments and modern APIs, %20 is standard. Both decode to a space, but %20 is more universally correct.