URL Encoder & Decoder
Encode and decode URLs and query parameters online using percent-encoding (RFC 3986). Supports UTF-8 strings, encodeURI, and encodeURIComponent.
Recently Used Tools
Understanding Percent-Encoding (URL Encoding)
Uniform Resource Locators (URLs) can only be transmitted over the Internet using the US-ASCII character set. Characters outside this unreserved set—such as spaces, punctuation, symbols, and non-Latin scripts—must be converted into a valid ASCII format. This conversion process is called Percent-Encoding or URL Encoding (defined by RFC 3986).
Reserved vs. Unreserved Characters
RFC 3986 divides characters into unreserved characters (alphanumeric characters A-Z, a-z, 0-9, and - _ . ~) which never need encoding, and reserved characters (such as : / ? # [ ] @ ! $ & ' ( ) * + , ; =). Reserved characters have special syntax meanings within a URI. For example, ? demarcates the query string and & separates query parameters.
encodeURI vs. encodeURIComponent
Choosing the correct JavaScript URL encoding function depends on the context:
- encodeURI(): Used when you want to encode a complete, valid URL. It preserves protocol delimiters (
http://), domain slashes, and query indicators (?). - encodeURIComponent(): Used when encoding a single parameter key or value to be embedded inside a query string. It encodes reserved characters like
/,?, and&so they don't break the query string structure.
UTF-8 Character Conversion
When encoding international characters or emojis (e.g. café or 🚀), the browser first converts the character into its UTF-8 multi-byte representation. Each byte is then represented by a percent sign followed by a two-digit hexadecimal number (e.g. %C3%A9 for é).
Frequently Asked Questions
What is the difference between encodeURI and encodeURIComponent?
encodeURI() is designed to encode a full URL while preserving reserved protocol and domain characters like http://, ?, and /. encodeURIComponent() encodes ALL reserved characters, making it suitable for individual query string values.
Why should space be encoded as %20 vs +?
Standard URL Percent-Encoding uses %20 for spaces. The plus (+) sign for spaces is specific to application/x-www-form-urlencoded form data submissions.
Is it safe to encode URLs containing non-ASCII international characters?
Yes! Modern JavaScript converts non-ASCII Unicode characters (like emojis or foreign scripts) to their UTF-8 byte sequences before percent-encoding each byte.
Are my URL strings logged or tracked?
Never. FreeFileTool encodes and decodes URLs locally using browser APIs. Your URLs and parameter strings are never sent to any server.