URL Encode & Decode

Percent-encode text for URLs or decode encoded URLs back to plain text. Runs entirely in your browser.

What is URL Encoding (Percent-Encoding) and When Do You Need It?

URL encoding, also known as percent-encoding, is a method of converting characters that aren't allowed in a URL into a safe format using a % sign followed by two hexadecimal digits. This is defined in RFC 3986 and is essential for properly constructing URLs with special characters, spaces, or non-ASCII text.

Characters That Must Be URL-Encoded

Common Developer Scenarios for URL Encoding

URL Encoding vs HTML Entity Encoding — What's the Difference?

URL encoding (%26) is used in URLs and query strings. HTML entity encoding (&) is used in HTML documents. They serve different purposes: URL encoding ensures URL validity, while HTML encoding prevents XSS and ensures correct rendering in browsers. Use the right encoding for the right context.

How This URL Encoder/Decoder Works

This tool uses JavaScript's built-in encodeURIComponent() and decodeURIComponent() functions, which follow the RFC 3986 standard. Toggle between Encode and Decode mode, paste your text, and press Ctrl+Enter or click the button. Use the Swap feature to quickly decode an encoded URL and re-encode it.

Frequently Asked Questions

This tool uses JavaScript's built-in encodeURIComponent() for encoding and decodeURIComponent() for decoding, following the RFC 3986 standard. Special characters are converted to percent-encoded format (%XX). All processing runs in your browser.
Characters that must be encoded include spaces (%20), ampersands (%26), equals signs (%3D), question marks (%3F), hash symbols (%23), plus signs (%2B), and all non-ASCII characters like accented letters and emoji. Letters (A-Z, a-z), digits (0-9), and a few special characters (- _ . ~) are safe and don't need encoding.
encodeURI() is for encoding a complete URL — it preserves characters like :, /, ?, #, and & that have special meaning in URLs. encodeURIComponent() encodes everything except letters, digits and - _ . ! ~ * ' ( ), making it suitable for encoding individual query parameter values. Use encodeURIComponent() for values and encodeURI() for full URLs.
%20 is the standard percent-encoding for spaces in URLs (RFC 3986). The + sign represents spaces only in HTML form submissions using application/x-www-form-urlencoded format (RFC 1866). Both are valid but used in different contexts. This tool uses %20 which is the universally accepted encoding.
Input processing is local to this tool. Shared page features may make network requests, and enabled browser drafts may retain text locally. Avoid pasting credentials or confidential material.