🔗 URL Encoder/Decoder

Encode and decode URLs with proper encodeURIComponent/decodeURIComponent.

Input
Output
Your result will appear here...
0 chars · 0 lines · Press Ctrl+Enter to process

What Is URL Encoding?

URL encoding (percent-encoding) converts characters that are not allowed in URLs into a safe format. Spaces become %20, special characters like & become %26, and non-ASCII characters are encoded as %XX sequences. This ensures URLs are valid and unambiguous.

How to Use

Paste text or a URL-encoded string into the input area. Click "Encode URL" to convert special characters to their percent-encoded form. Click "Decode URL" to convert percent-encoded sequences back to readable characters.

Usage Example

Encoding:

Input:  https://example.com/search?q=hello world & category=A
Output: https%3A%2F%2Fexample.com%2Fsearch%3Fq%3Dhello%20world%20%26%20category%3DA

Decoding:

Input:  hello%20world%21
Output: hello world!

encodeURIComponent vs encodeURI

This tool uses encodeURIComponent(), which encodes all special characters including ?, &, =, #, and /. Use this for encoding query parameter values. The alternative encodeURI() preserves URL-structural characters and is better for encoding entire URLs.

Frequently Asked Questions

Why do spaces need to be encoded in URLs?

URLs can only contain a limited set of ASCII characters. Spaces, special characters, and Unicode must be encoded to be valid in a URL according to RFC 3986.

Is URL encoding the same as HTML encoding?

No. URL encoding uses %XX (percent-encoding). HTML encoding uses &name; entities like &. They serve different purposes in different contexts.